Kendryte build warnings

Heinrich Schuchardt xypron.glpk at gmx.de
Tue Jul 28 17:50:38 CEST 2020


On 28.07.20 15:20, Sean Anderson wrote:
> On 7/28/20 8:31 AM, Heinrich Schuchardt wrote:
>> On 28.07.20 13:07, Sean Anderson wrote:
>>> On 7/28/20 6:56 AM, Heinrich Schuchardt wrote:
>>>> Hello Sean,
>>>>
>>>> when I compile for Kendryte K210 I see the following build warnings:
>>>>
>>>> In file included from drivers/clk/kendryte/clk.c:15:
>>>> include/kendryte/pll.h:46: warning: "nop" redefined
>>>>    46 | #define nop()
>>>>       |
>>>> In file included from ./arch/riscv/include/asm/io.h:13,
>>>>                  from drivers/clk/kendryte/clk.c:7:
>>>> ./arch/riscv/include/asm/barrier.h:16: note: this is the location of the
>>>> previous definition
>>>>    16 | #define nop()  __asm__ __volatile__ ("nop")
>>>>       |
>>>> In file included from ./arch/riscv/include/asm/io.h:13,
>>>>                  from drivers/clk/kendryte/pll.c:8:
>>>> ./arch/riscv/include/asm/barrier.h:16: warning: "nop" redefined
>>>>    16 | #define nop()  __asm__ __volatile__ ("nop")
>>>>       |
>>>> In file included from drivers/clk/kendryte/pll.c:6:
>>>> include/kendryte/pll.h:46: note: this is the location of the previous
>>>> definition
>>>>    46 | #define nop()
>>>>       |
>>>>
>>>> Should nop() be the assembler instruction nop or nothing?
>>>
>>> It should be the assembler instruction. The redefinion is to allow
>>> testing the frequency calculation function on the sandbox architecture
>>> (which has no nops). The actual code which uses the nop is never called,
>>> but it still gets compiled, so I added a shim. Can you send me the
>>> config you are using?
>>>
>>> --Sean
>>>
>>
>> Please, find the config file appended.
>>
>> I will provide a patch
>>
>> #ifndef nop()
>> #define nop()
>> #endif
>
> That's about what I was thinking.
>
>> Another issue I found is that the memory size is not correctly set on
>> the Kendryte as reported by bdinfo.
>>
>> DRAM bank   = 0x0000000000000000
>> -> start    = 0x0000000080000000
>> -> size     = 0x0000000000400000
>> DRAM bank   = 0x0000000000000001
>> -> start    = 0x0000000080400000
>> -> size     = 0x0000000000200000
>> DRAM bank   = 0x0000000000000002
>> -> start    = 0x0000000080600000
>> -> size     = 0x0000000000200000
>> memstart    = 0x0000000000000000
>> memsize     = 0x00000000         <<<<<<<<<<
>>
>> I would have expected memsize = 0x800000.
>
> Ok, I will look into that.

This seems to be general problem. I see the same on the Odroid C2.

memstart    = 0x0000000000000000
memsize     = 0x00000000

You could fill this information in

fdtdec_setup_memory_banksize();

But I think it would be more reasonable to do this in board_init_f().

Best regards

Heinrich

>
>>
>> On my MaixDuino I have an SD card slot which is connected to SPI0.
>>
>>  ** MOSI - pin 28
>>  ** MISO - pin 26
>>  ** CLK  - pin 27
>>  ** CS   - pin 29
>>
>> Is there any ongoing work to enable the SD card slot on U-Boot yet?
>
> Yes, I have an old patch series [1] to add SPI support. I stopped
> working on it while I was waiting for the series it depends on to be
> merged. I will probably start work on it again when the GPIO/Pinmux
> series [2] gets accepted. Be warned that it is buggy (sometimes there
> are weird erase bugs) and the SD card slot does not work, only the SPI.
> I'll gladly accept any help in this area, since I don't really have the
> equipment (logic analyzer/oscilloscope) necessary to debug the SPI
> protocol.
>
> [1] https://patchwork.ozlabs.org/project/uboot/list/?series=162653
> [2] https://patchwork.ozlabs.org/project/uboot/list/?series=185489
>
> --Sean
>



More information about the U-Boot mailing list