This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to specify virtual Address for pl011 uart in linux kernel

Hi,

I am a beginner in kernel porting. I am trying to port Linux kernel (version- 4.9.22) on Custom SoC (cpu = arm1176jzfs based) for custom evaluation Board. I am having ARM Prime cell pl011 UART in my SoC. And it is physically mapped to 0x5800_1000 address. While i am trying to use it as Debug UART, kernel is asking for its virtual Address. How should i configure this option.

i.e:
    -> Kernel low-level debugging functions
        -> kernel low-level debugging port (Kernel low-level debugging on via ARM Ltd PL01x Primecell UART)
    (0x58001000) Physical base address of debug UART
    (??) Virtual base address of debug UART

Thanks,

Vivek T.

Parents
  • Hi Matt,


    VIC translation fault got resolved. From your suggestion I have gone through other drivers in the kernel, I have incorporated a small piece of code using ioremap() to obtain a virtual address. Looks like now the VIC is initialized and I am able to see the Peripheral ID while booting. Below is the code I have incorporated into my IRQ init function

    {
    void __iomem *vic_base;
    Int i =0;
    for(i = 0; i<2; i++) {
            if (!request_mem_region(bbsoc_vic[i].start, VIC_SIZE, "Vic")) {
            pr_err("Vic_%d Request mem region failed.\n", i);
            return –1;
    }
    vic_base = ioremap(bbsoc_vic[i].start, VIC_SIZE);
    if(!vic_base) {
            pr_err("VIC_%d : ioremap failed...\n\r", i);
            release_mem_region(bbsoc_vic[i].start, VIC_SIZE);
            return –1;
    }

    If (I == 0)
            vic_init(vic_base, 0, BBSOC_VIC0_IRQ_MASK, 0);
    If(I == 1)
            vic_init(vic_base, 32, BBSOC_VIC0_IRQ_MASK, 0);
    }


    With this, my issue got resolved. and I am unsure about the uart virtual address, Parallelly I need to work on other issues too. Will get back to you once I found anything.  Thanks for helping me, Matt.

    Thanks,

    Vivek

Reply
  • Hi Matt,


    VIC translation fault got resolved. From your suggestion I have gone through other drivers in the kernel, I have incorporated a small piece of code using ioremap() to obtain a virtual address. Looks like now the VIC is initialized and I am able to see the Peripheral ID while booting. Below is the code I have incorporated into my IRQ init function

    {
    void __iomem *vic_base;
    Int i =0;
    for(i = 0; i<2; i++) {
            if (!request_mem_region(bbsoc_vic[i].start, VIC_SIZE, "Vic")) {
            pr_err("Vic_%d Request mem region failed.\n", i);
            return –1;
    }
    vic_base = ioremap(bbsoc_vic[i].start, VIC_SIZE);
    if(!vic_base) {
            pr_err("VIC_%d : ioremap failed...\n\r", i);
            release_mem_region(bbsoc_vic[i].start, VIC_SIZE);
            return –1;
    }

    If (I == 0)
            vic_init(vic_base, 0, BBSOC_VIC0_IRQ_MASK, 0);
    If(I == 1)
            vic_init(vic_base, 32, BBSOC_VIC0_IRQ_MASK, 0);
    }


    With this, my issue got resolved. and I am unsure about the uart virtual address, Parallelly I need to work on other issues too. Will get back to you once I found anything.  Thanks for helping me, Matt.

    Thanks,

    Vivek

Children
No data