OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 24, 2024 2:08 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Configuration UART on Intel Galileo
PostPosted: Sat Dec 17, 2016 7:04 am 
Offline

Joined: Sat Dec 17, 2016 6:47 am
Posts: 1
Hey everyone,
I came with a question,
i tried to configure UART port on Intel Galileo, to be able to write and read through PUTTY, here is my code:
Code:
//Turn on UART
   RegAddr DMA_CFG;
   DMA_CFG.raw = 0;

   DMA_CFG.bus = 0;
   DMA_CFG.dev = 20;
   DMA_CFG.func = 1;
   DMA_CFG.reg_off = 0x14;
   DMA_CFG.en_mapping = 1;
   UINT32 * DMA_addr = getAddressFromPCI(DMA_CFG.raw | 0x80000000);   

   DMA_addr[0] = 0x01;

   //Get BAR0
   RegAddr BAR0;
   BAR0.raw = 0;
   
   BAR0.bus = 0;
   BAR0.dev = 20;
   BAR0.func = 1;
   BAR0.reg_off = 0x10;   
   BAR0.en_mapping = 1;

   UINT32 BAR0_addr = getAddressFromPCI(BAR0.raw | 0x80000000);   

   //Turn on DDL register
   UINT32 * LCR = BAR0_addr + 0xC;
   LCR[0] = 0x80;
   //Set DDL regisrer
   UINT32 * RBR_THR_DLL = BAR0_addr;
   RBR_THR_DLL[0] = 0x18;
   
   //Set IIR
   UINT32 * IIR_FCR = BAR0_addr + 0x8;
   IIR_FCR[0] = 0x01;
   //Turn on IIR register
   LCR[0] = 0x0;
   
   //Clear IER register
   UINT32 * IER_DLH = BAR0_addr + 0x4;
   IER_DLH[0] = 0x0;   
   
   UINT32 * LSR = BAR0_addr + 0x14;

   while(TRUE) {
      UINT32 lsr_data = LSR[0] & 0x20;
      if (lsr_data == 0x20)
         break;
      
   }

   RBR_THR_DLL[0] = 's';


but it does not work. I put a character in THR register but it did not comes up. I tried to follow specifications of Intel Quark SoC X1000 but i am not sure that i understood all of that informations.

Thanks in advance for Your answers


Top
 Profile  
 
 Post subject: Re: Configuration UART on Intel Galileo
PostPosted: Sat Dec 17, 2016 10:58 am 
Offline

Joined: Thu Dec 08, 2016 12:32 pm
Posts: 5
If you try to enable pooling mode, you don't need DMA_CFG.
Config:
Code:
   //Get IER_DLH
   UINT32 * IER_DLH = BAR0_addr + 0x4;

   //Turn on DDL register
   UINT32 * LCR = BAR0_addr + 0xC;
   LCR[0] = 0x80;

   //Set DDL regisrer
   RBR_THR_DLL = BAR0_addr;
   RBR_THR_DLL[0] = 0x18;

   //Turn off DLAB
   LCR[0] = 0x03;
   UINT32 * IIR_FCR = BAR0_addr + 0x8;
   IIR_FCR[0] = 0x7;
   IER_DLH[0] = IER_DLH[0] & ~0x8F;   
   LSR = BAR0_addr + 0x14;


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 170 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group