Hi Sathya,

The seL4 kernel defines available kernel devices in the platform dependent 
hardware.h file.

The kernel_devices[] structure contains all the hardware devices that the 
kernel needs access to. For most platforms, this is just the GIC, but if 
CONFIG_PRINTING is enabled, the uart is added as well.

The code below is from the zynqmp hardware.h file:

#ifdef CONFIG_PRINTING
    },
    {
        /*  UART */
        UART_PADDR,
        UART_PPTR,
        true  /* armExecuteNever */
#endif /* CONFIG_PRINTING */
    }

So that device defines the UART physical address, virtual address, and whether 
the device is allowed to execute. The kernel_devices structure gets used with 
the map_kernel_devices function so that the UART gets mapped from UART_PADDR -> 
UART_PPTR. Software can then use the virtual address to send and receive 
characters from the UART.

#define UART_REG(x) ((volatile uint32_t *)(UART_PPTR + (x)))

    while (!(*UART_REG(XUARTPS_SR) & XUARTPS_SR_TXEMPTY));
    *UART_REG(XUARTPS_FIFO) = c;

Let me know if you have any other questions.

Chris Guikema

Embedded Systems Engineer
DornerWorks, Ltd.

From: Devel [mailto:[email protected]] On Behalf Of Sathya Narayanan N
Sent: Thursday, July 19, 2018 4:27 AM
To: [email protected]
Subject: Re: [seL4] Understanding how SEL4 recognises UART on board

Hi Experts,

I am curious to know how SEL4 recognises the existence of UART on the board and 
mapped to a particular memory address.

 I see there is no DTB/ DTS files read from memory.
could someone help me understand the concept here ?
Or is it something hardcoded in the kernel ?




--
 regards,
Sathya


_______________________________________________
Devel mailing list
[email protected]
https://sel4.systems/lists/listinfo/devel

Reply via email to