Re: [U-Boot] U-Boot

On 02/12/2018 03:52 PM, Mariano Coromac wrote:
Hello, I was hoping you could help me out with something. I just have 2 main questions. I am using a SAMA5D27 and I've managed to port AT91Bootloader and I'm currently on U-Boot
U-Boot SPL can bring SAMA5D2 up, you don't need the AT91 bootloader.
- I am trying to use FLEXCOM1 (UART) as the main console of U-Boot but
haven't been able to find any documentation saying where or how U-Boot specifies the console port.
$ git grep DEBUG_UART configs/sama5d2* configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART=y configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART_ATMEL=y configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART_BASE=0xf8020000 configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART_CLOCK=82000000 configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART_BOARD_INIT=y configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART_ANNOUNCE=y
would indicate there's a debug uart which you can use.
I'm adding atmel maintainer to CC and dropping dead contacts.
- When U-Boot tries to boot it gives me these errors:
bind node sdio-host@a0000000 - attempt to match compatible string 'atmel,sama5d2-sdhci' No match for node 'sdio-host@a0000000' bind node sdio-host@b0000000 - attempt to match compatible string 'atmel,sama5d2-sdhci' No match for node 'sdio-host@b0000000' bind node apb - attempt to match compatible string 'simple-bus' - found match at 'generic_simple_bus' bind node pmc@f0014000 - attempt to match compatible string 'atmel,sama5d2-pmc' - found match at 'at91-pmc' bind node mainck - attempt to match compatible string 'atmel,at91sam9x5-clk-main' - found match at 'at91sam9x5-main-osc-clk' bind node pllack@0 - attempt to match compatible string 'atmel,sama5d3-clk-pll' - found match at 'at91-plla-clk' bind node utmick - attempt to match compatible string 'atmel,at91sam9x5-clk-utmi' No match for node 'utmick' bind node masterck - attempt to match compatible string 'atmel,at91sam9x5-clk-master' - found match at 'at91-master-clk' bind node h32mxck - attempt to match compatible string 'atmel,sama5d4-clk-h32mx' No match for node 'h32mxck' bind node periph32ck - attempt to match compatible string 'atmel,at91sam9x5-clk-peripheral' - found match at 'sam9x5-periph-clk' Cannot create device named 'uart1_clk@25' (err=-12) Error binding driver 'sam9x5-periph-clk': -12 bind node periph64ck - attempt to match compatible string 'atmel,at91sam9x5-clk-peripheral' - found match at 'sam9x5-periph-clk' Error binding driver 'sam9x5-periph-clk': -12 bind node gck - attempt to match compatible string 'atmel,sama5d2-clk-generated' No match for node 'gck' Some drivers failed to bind Error binding driver 'at91-pmc': -12 bind node spi@f8000000 - attempt to match compatible string 'atmel,at91rm9200-spi' No match for node 'spi@f8000000' bind node serial@f8038200 - attempt to match compatible string 'atmel,at91sam9260-usart' - found match at 'serial_atmel' Error binding driver 'serial_atmel': -12 bind node gpio@fc038000 - attempt to match compatible string 'atmel,sama5d2-gpio' - found match at 'gpio_atmel_pio4' Error binding driver 'gpio_atmel_pio4': -12 Some drivers failed to bind Error binding driver 'generic_simple_bus': -12 Some drivers failed to bind Error binding driver 'generic_simple_bus': -12 Some drivers failed to bind initcall sequence 26f20864 failed at call 26f073e4 (err=-12) ### ERROR ### Please RESET the board ###
NOTE: On my lists.c file I changed all the "dm_debug" for "dm_warn" because the debug uart is the only one that's responding. Any help or guidance would be really appreciated.
Seems like some drivers are disabled.
Which version of U-Boot do you use ?
What platform did you derive your configuration from ?

Oh ok. My main problem is that I DO have debug_uart but I don't have U-Boot main console. I already have the configuration on my defconf for the debug UART like this: CONFIG_DM=y CONFIG_DM_SERIAL=y CONFIG_DEBUG_UART=y CONFIG_DEBUG_UART_ATMEL=y CONFIG_DEBUG_UART_BASE=0xf8038200 CONFIG_DEBUG_UART_CLOCK=58000000 CONFIG_DEBUG_UART_BOARD_INIT=y CONFIG_DEBUG_UART_ANNOUNCE=y I cloned from the github repository *https://github.com/linux4sam/u-boot-at91 https://github.com/linux4sam/u-boot-at91* My configuration was derived from the sama5d2_xplained board because I'm working with a custom one.
On Mon, Feb 12, 2018 at 8:59 AM, Marek Vasut marex@denx.de wrote:
On 02/12/2018 03:52 PM, Mariano Coromac wrote:
Hello, I was hoping you could help me out with something. I just have 2 main questions. I am using a SAMA5D27 and I've managed to port AT91Bootloader and I'm currently on U-Boot
U-Boot SPL can bring SAMA5D2 up, you don't need the AT91 bootloader.
- I am trying to use FLEXCOM1 (UART) as the main console of U-Boot but
haven't been able to find any documentation saying where or how U-Boot specifies the console port.
$ git grep DEBUG_UART configs/sama5d2* configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART=y configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART_ATMEL=y configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART_BASE=0xf8020000 configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART_CLOCK=82000000 configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART_BOARD_INIT=y configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART_ANNOUNCE=y
would indicate there's a debug uart which you can use.
I'm adding atmel maintainer to CC and dropping dead contacts.
- When U-Boot tries to boot it gives me these errors:
bind node sdio-host@a0000000
- attempt to match compatible string 'atmel,sama5d2-sdhci'
No match for node 'sdio-host@a0000000' bind node sdio-host@b0000000
- attempt to match compatible string 'atmel,sama5d2-sdhci'
No match for node 'sdio-host@b0000000' bind node apb
- attempt to match compatible string 'simple-bus'
- found match at 'generic_simple_bus'
bind node pmc@f0014000
- attempt to match compatible string 'atmel,sama5d2-pmc'
- found match at 'at91-pmc'
bind node mainck
- attempt to match compatible string 'atmel,at91sam9x5-clk-main'
- found match at 'at91sam9x5-main-osc-clk'
bind node pllack@0
- attempt to match compatible string 'atmel,sama5d3-clk-pll'
- found match at 'at91-plla-clk'
bind node utmick
- attempt to match compatible string 'atmel,at91sam9x5-clk-utmi'
No match for node 'utmick' bind node masterck
- attempt to match compatible string 'atmel,at91sam9x5-clk-master'
- found match at 'at91-master-clk'
bind node h32mxck
- attempt to match compatible string 'atmel,sama5d4-clk-h32mx'
No match for node 'h32mxck' bind node periph32ck
- attempt to match compatible string 'atmel,at91sam9x5-clk-
peripheral'
- found match at 'sam9x5-periph-clk'
Cannot create device named 'uart1_clk@25' (err=-12) Error binding driver 'sam9x5-periph-clk': -12 bind node periph64ck
- attempt to match compatible string 'atmel,at91sam9x5-clk-
peripheral'
- found match at 'sam9x5-periph-clk'
Error binding driver 'sam9x5-periph-clk': -12 bind node gck
- attempt to match compatible string 'atmel,sama5d2-clk-generated'
No match for node 'gck' Some drivers failed to bind Error binding driver 'at91-pmc': -12 bind node spi@f8000000
- attempt to match compatible string 'atmel,at91rm9200-spi'
No match for node 'spi@f8000000' bind node serial@f8038200
- attempt to match compatible string 'atmel,at91sam9260-usart'
- found match at 'serial_atmel'
Error binding driver 'serial_atmel': -12 bind node gpio@fc038000
- attempt to match compatible string 'atmel,sama5d2-gpio'
- found match at 'gpio_atmel_pio4'
Error binding driver 'gpio_atmel_pio4': -12 Some drivers failed to bind Error binding driver 'generic_simple_bus': -12 Some drivers failed to bind Error binding driver 'generic_simple_bus': -12 Some drivers failed to bind initcall sequence 26f20864 failed at call 26f073e4 (err=-12) ### ERROR ### Please RESET the board ###
NOTE: On my lists.c file I changed all the "dm_debug" for "dm_warn" because the debug uart is the only one that's responding. Any help or guidance would be really appreciated.
Seems like some drivers are disabled.
Which version of U-Boot do you use ?
What platform did you derive your configuration from ?
-- Best regards, Marek Vasut

On 02/12/2018 04:13 PM, Mariano Coromac wrote:
Oh ok. My main problem is that I DO have debug_uart but I don't have U-Boot main console. I already have the configuration on my defconf for the debug UART like this: CONFIG_DM=y CONFIG_DM_SERIAL=y CONFIG_DEBUG_UART=y CONFIG_DEBUG_UART_ATMEL=y CONFIG_DEBUG_UART_BASE=0xf8038200 CONFIG_DEBUG_UART_CLOCK=58000000 CONFIG_DEBUG_UART_BOARD_INIT=y CONFIG_DEBUG_UART_ANNOUNCE=y I cloned from the github repository *https://github.com/linux4sam/u-boot-at91* My configuration was derived from the sama5d2_xplained board because I'm working with a custom one.
If you used vendor fork of U-Boot, please ask vendor, the U-Boot upstream repo is at [1]. You should rather use that. Adding more Atmel people on CC, they should be able to help.
You should also tell us which version (or even better, which commit in which repo) do you use. That's important.
Also please stop top-posting.
[1] http://git.denx.de/?p=u-boot.git;a=summary
On Mon, Feb 12, 2018 at 8:59 AM, Marek Vasut <marex@denx.de mailto:marex@denx.de> wrote:
On 02/12/2018 03:52 PM, Mariano Coromac wrote: > Hello, I was hoping you could help me out with something. I just have 2 > main questions. I am using a SAMA5D27 and I've managed to port > AT91Bootloader and I'm currently on U-Boot U-Boot SPL can bring SAMA5D2 up, you don't need the AT91 bootloader. > 1. I am trying to use FLEXCOM1 (UART) as the main console of U-Boot but > haven't been able to find any documentation saying where or how U-Boot > specifies the console port. $ git grep DEBUG_UART configs/sama5d2* configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART=y configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART_ATMEL=y configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART_BASE=0xf8020000 configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART_CLOCK=82000000 configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART_BOARD_INIT=y configs/sama5d27_som1_ek_mmc_defconfig:CONFIG_DEBUG_UART_ANNOUNCE=y would indicate there's a debug uart which you can use. I'm adding atmel maintainer to CC and dropping dead contacts. > 2. When U-Boot tries to boot it gives me these errors: > > bind node sdio-host@a0000000 > - attempt to match compatible string 'atmel,sama5d2-sdhci' > No match for node 'sdio-host@a0000000' > bind node sdio-host@b0000000 > - attempt to match compatible string 'atmel,sama5d2-sdhci' > No match for node 'sdio-host@b0000000' > bind node apb > - attempt to match compatible string 'simple-bus' > - found match at 'generic_simple_bus' > bind node pmc@f0014000 > - attempt to match compatible string 'atmel,sama5d2-pmc' > - found match at 'at91-pmc' > bind node mainck > - attempt to match compatible string 'atmel,at91sam9x5-clk-main' > - found match at 'at91sam9x5-main-osc-clk' > bind node pllack@0 > - attempt to match compatible string 'atmel,sama5d3-clk-pll' > - found match at 'at91-plla-clk' > bind node utmick > - attempt to match compatible string 'atmel,at91sam9x5-clk-utmi' > No match for node 'utmick' > bind node masterck > - attempt to match compatible string 'atmel,at91sam9x5-clk-master' > - found match at 'at91-master-clk' > bind node h32mxck > - attempt to match compatible string 'atmel,sama5d4-clk-h32mx' > No match for node 'h32mxck' > bind node periph32ck > - attempt to match compatible string 'atmel,at91sam9x5-clk-peripheral' > - found match at 'sam9x5-periph-clk' > Cannot create device named 'uart1_clk@25' (err=-12) > Error binding driver 'sam9x5-periph-clk': -12 > bind node periph64ck > - attempt to match compatible string 'atmel,at91sam9x5-clk-peripheral' > - found match at 'sam9x5-periph-clk' > Error binding driver 'sam9x5-periph-clk': -12 > bind node gck > - attempt to match compatible string 'atmel,sama5d2-clk-generated' > No match for node 'gck' > Some drivers failed to bind > Error binding driver 'at91-pmc': -12 > bind node spi@f8000000 > - attempt to match compatible string 'atmel,at91rm9200-spi' > No match for node 'spi@f8000000' > bind node serial@f8038200 > - attempt to match compatible string 'atmel,at91sam9260-usart' > - found match at 'serial_atmel' > Error binding driver 'serial_atmel': -12 > bind node gpio@fc038000 > - attempt to match compatible string 'atmel,sama5d2-gpio' > - found match at 'gpio_atmel_pio4' > Error binding driver 'gpio_atmel_pio4': -12 > Some drivers failed to bind > Error binding driver 'generic_simple_bus': -12 > Some drivers failed to bind > Error binding driver 'generic_simple_bus': -12 > Some drivers failed to bind > initcall sequence 26f20864 failed at call 26f073e4 (err=-12) > ### ERROR ### Please RESET the board ### > > NOTE: On my lists.c file I changed all the "dm_debug" for "dm_warn" > because the debug uart is the only one that's responding. > Any help or guidance would be really appreciated. Seems like some drivers are disabled. Which version of U-Boot do you use ? What platform did you derive your configuration from ? -- Best regards, Marek Vasut
-- Mariano Coromac https://gps.gt/ I&D of Electronics Engineer mcoromac@stsa.info mailto:mcoromac@stsa.info +502 41544712 www.gps.gt http://www.gps.gt http://facebook.com/startracksa

Sorry, I tried to switch to the upstream repo but it gave some compiling errors. I am using the 409952795f8a28d3c266b2b8b2b9eccf46347601 commit from git:// github.com/linux4sam/u-boot-at91.git

On 12/02/2018 at 17:28, Mariano Coromac wrote:
Sorry, I tried to switch to the upstream repo but it gave some compiling errors. I am using the 409952795f8a28d3c266b2b8b2b9eccf46347601 commit from git://github.com/linux4sam/u-boot-at91.git http://github.com/linux4sam/u-boot-at91.git
Can you tell us what is the compiling error that you are experiencing?
Best regards,

With that one there is none, I had problems with the other one. Right now I just want to know how the CONIG parameters like this one: CONFIG_8xx_CONS_SMC1= Apply to my SAMA5D2. I already have my debug uart working but not the monitor console. Therefore I can't even print 'help'. Also, I'm still having trouble with the drivers as you can see above.

On 12/02/2018 at 18:13, Mariano Coromac wrote:
With that one there is none, I had problems with the other one.
I don't understand this sentence.
Right now I just want to know how the CONIG parameters like this one: CONFIG_8xx_CONS_SMC1=
I don't see such parameter in a sama5d2 xplained .config.
For a sama5d2 xplained board, you can refer to these files for configuration: include/configs/at91-sama5_common.h include/configs/sama5d2_xplained.h configs/sama5d2_xplained_spiflash_defconfig and other defconfigs and you can follow the initialization phase from: board/atmel/sama5d2_xplained/sama5d2_xplained.c
Device tree files are also important: arch/arm/dts/at91-sama5d2_xplained.dts
Apply to my SAMA5D2. I already have my debug uart working but not the monitor console. Therefore I can't even print 'help'. Also, I'm still having trouble with the drivers as you can see above.
On the u-boot-2017.03-at91 branch of our vendor tree, you have an example of moving the console from one USART to the other with this commit: 74f976f8d1fe714b5b28d450e7213657ca8dd71e (board: atmel: sama5d2_ptc_ek: use uart0 as console output)
Best regards,

Thanks for the info. Apparently now the console is redirected but I keep getting these driver errors: bind node serial@f8038200 - attempt to match compatible string 'atmel,at91sam9260-usart' - found match at 'serial_atmel' Error binding driver 'serial_atmel': -12
For what I understand, the drivers are found but not binded. Any idea why? All the parameters seemed to be correct. I found the function declared in System.map and u-boot.map Does this have to do with uclass.c? I don't know if I am correct but that one is in charge of handling all the drivers.

Hi Mariano,
On 13 February 2018 at 09:00, Mariano Coromac mcoromac@stsa.info wrote:
Thanks for the info. Apparently now the console is redirected but I keep getting these driver errors: bind node serial@f8038200
- attempt to match compatible string 'atmel,at91sam9260-usart'
- found match at 'serial_atmel'
Error binding driver 'serial_atmel': -12
For what I understand, the drivers are found but not binded. Any idea why? All the parameters seemed to be correct. I found the function declared in System.map and u-boot.map Does this have to do with uclass.c? I don't know if I am correct but that one is in charge of handling all the drivers.
$ grep 12 include/linux/errno.h #define ENOMEM 12 /* Out of memory */
You could look at CONFIG_SYS_MALLOC_F_LEN and make it a little larger?
Regards, Simon

Thank you very much. I expanded the malloc into a bigger number and now I don't get those errors. My remaining problem is that I can't seem to move the serial console or console monitor (I don't know which term is better) into my flexcom1 usart. It always keep saying:
No serial driver found resetting ...
I followed the example that Nicolas pointed to (modified the stdout-path, modified the address, modified the pins, added the serial port into my device tree, modified all the CONFIGS in my defconfig file) but still I don't know why it doesn't link.
My device tree is alright because now I see that the drivers do get binded. If I disable the CONFIG_DEBUG_UART=n nothing gets displayed but if I activate it, it shows me the message above. Any idea on how to debug this help would be appreciated.

Hi Mariano,
On 13 February 2018 at 15:23, Mariano Coromac mcoromac@stsa.info wrote:
Thank you very much. I expanded the malloc into a bigger number and now I don't get those errors. My remaining problem is that I can't seem to move the serial console or console monitor (I don't know which term is better) into my flexcom1 usart. It always keep saying:
No serial driver found resetting ...
I followed the example that Nicolas pointed to (modified the stdout-path, modified the address, modified the pins, added the serial port into my device tree, modified all the CONFIGS in my defconfig file) but still I don't know why it doesn't link.
My device tree is alright because now I see that the drivers do get binded. If I disable the CONFIG_DEBUG_UART=n nothing gets displayed but if I activate it, it shows me the message above. Any idea on how to debug this help would be appreciated.
You can look at serial_find_console_or_panic() and add a call to dm_dump_all() to print out the device list. Hopefully you can see your device in the list?
Regards, Simon

Hmmmm it displays the following: <debug_uart> Class Probed Name ---------------------------------------- root [ + ] root_driver simple_bus [ ] `-- ahb mmc [ ] |-- sdio-host@a0000000 blk [ ] | `-- sdio-host@a0000000.blk mmc [ ] |-- sdio-host@b0000000 blk [ ] | `-- sdio-host@b0000000.blk simple_bus [ ] `-- apb simple_bus [ ] |-- pmc@f0014000 clk [ ] | |-- mainck clk [ ] | |-- pllack@0 clk [ ] | |-- utmick clk [ ] | |-- masterck clk [ ] | |-- h32mxck misc [ ] | |-- periph32ck clk [ ] | | |-- pioA_clk@18 clk [ ] | | |-- uart0_clk@24 clk [ ] | | |-- uart1_clk@25 clk [ ] | | |-- uart2_clk@26 clk [ ] | | `-- spi0_clk@33 misc [ ] | |-- periph64ck clk [ ] | | |-- sdmmc0_hclk@31 clk [ ] | | |-- sdmmc1_hclk@32 clk [ ] | | |-- qspi0_clk@52 clk [ ] | | `-- qspi1_clk@53 misc [ ] | `-- gck clk [ ] | |-- sdmmc0_gclk@31 clk [ ] | `-- sdmmc1_gclk@32 spi [ ] |-- spi@f8000000 serial [ ] |-- serial@f8038200 gpio [ ] `-- gpio@fc038000 pinctrl [ ] `-- pinctrl pinconfig [ ] |-- sdmmc0_cmd_dat_default pinconfig [ ] |-- sdmmc0_ck_cd_default pinconfig [ ] |-- sdmmc1_cmd_dat_default pinconfig [ ] |-- sdmmc1_ck_cd_default pinconfig [ ] |-- spi0_default pinconfig [ ] `-- serial0_default bind node serial@f8038200 - attempt to match compatible string 'atmel,at91sam9260-usart' - found match at 'serial_atmel' No serial driver found resetting ...
stdout is declared like this: stdout-path = &serial0;

I think I found the root problem for this. I am using a flexcom uart. The ones that are defined in sama5d2.dtsi are normal uarts, one can use those definitions alongside the drivers to use uart0 to uart4. I found a definition to use flexcom, here: https://github.com/linux4sam/linux-at91/blob/master/Documentation/devicetree... The problem I see is that I need a driver also and atmel did not provide one. Or at least I'm not seeing it because I have search for it around the entire project.
Could you confirm if my assumptions are correct? Because I see that the flexcom clocks are defined and makes me wonder if the problem is something else.

Forget it guys, I just realized what was wrong. reg = <0xf8038200 0x200>; Before it was reg = <0xf8038200 0x100>; So if anyone else (that wants to use the flexcom uart) asks you about this now there's another thing you can point to. If I encounter another problem or something I'll get back to you.

Hello Again, I have been working with UBoot but now when I try to boot my Linux kernel image that's inside my eMMC it displays the following: => boot CMD_SEND:0 ARG 0x00000000 RET -110 mmc_init: -110, time 10 ** Bad device mmc 1 ** CMD_SEND:0 ARG 0x00000000 RET -110 mmc_init: -110, time 11 ** Bad device mmc 1 **
I know it is a timeout error and I also know that the error occurs inside mmc-uclass line 31. I'm aware send_cmd() is defined in mmc.h but I honestly don't know how to dig deeper into this error.
mmc info works fine. Here's the mmc rescan log if it makes any use: => mmc rescan CMD_SEND:0 ARG 0x00000000 MMC_RSP_NONE CMD_SEND:8 ARG 0x000001AA RET -110 CMD_SEND:55 ARG 0x00000000 RET -110 CMD_SEND:0 ARG 0x00000000 MMC_RSP_NONE CMD_SEND:1 ARG 0x00000000 MMC_RSP_R3,4 0x00FF8080 CMD_SEND:1 ARG 0x40360080 MMC_RSP_R3,4 0xC0FF8080 CMD_SEND:2 ARG 0x00000000 MMC_RSP_R2 0xEB010D65 0x4D4D4320 0x205000AC 0x008E7300
DUMPING DATA 000 - EB 01 0D 65 004 - 4D 4D 43 20 008 - 20 50 00 AC 012 - 00 8E 73 00 CMD_SEND:3 ARG 0x00010000 MMC_RSP_R1,5,6,7 0x00000500 CMD_SEND:9 ARG 0x00010000 MMC_RSP_R2 0xD04F0132 0x0F5903FF 0xFFFFFFEF 0x8A400000
DUMPING DATA 000 - D0 4F 01 32 004 - 0F 59 03 FF 008 - FF FF FF EF 012 - 8A 40 00 00 CMD_SEND:13 ARG 0x00010000 MMC_RSP_R1,5,6,7 0x00000700 CURR STATE:3 CMD_SEND:7 ARG 0x00010000 MMC_RSP_R1,5,6,7 0x00000700 CMD_SEND:8 ARG 0x00000000 MMC_RSP_R1,5,6,7 0x00000900 CMD_SEND:8 ARG 0x00000000 MMC_RSP_R1,5,6,7 0x00000900 CMD_SEND:6 ARG 0x03B90100 MMC_RSP_R1b 0x00000800 CMD_SEND:13 ARG 0x00010000 MMC_RSP_R1,5,6,7 0x00000900 CURR STATE:4 CMD_SEND:8 ARG 0x00000000 MMC_RSP_R1,5,6,7 0x00000900 CMD_SEND:6 ARG 0x03B70100 MMC_RSP_R1b 0x00000800 CMD_SEND:13 ARG 0x00010000 MMC_RSP_R1,5,6,7 0x00000900 CURR STATE:4 CMD_SEND:8 ARG 0x00000000 MMC_RSP_R1,5,6,7 0x00000900 CMD_SEND:16 ARG 0x00000200 MMC_RSP_R1,5,6,7 0x00000900 CMD_SEND:17 ARG 0x00000000 MMC_RSP_R1,5,6,7 0x00000900
Any guidance would be appreciated. Thank you.
On Wed, Feb 14, 2018 at 3:27 PM, Mariano Coromac mcoromac@stsa.info wrote:
Forget it guys, I just realized what was wrong. reg = <0xf8038200 0x200>; Before it was reg = <0xf8038200 0x100>; So if anyone else (that wants to use the flexcom uart) asks you about this now there's another thing you can point to. If I encounter another problem or something I'll get back to you.

Hi Mariano,
On 2018/2/27 1:09, Mariano Coromac wrote:
Hello Again, I have been working with UBoot but now when I try to boot my Linux kernel image that's inside my eMMC it displays the following: => boot CMD_SEND:0 ARG 0x00000000 RET -110 mmc_init: -110, time 10 ** Bad device mmc 1 ** CMD_SEND:0 ARG 0x00000000 RET -110 mmc_init: -110, time 11 ** Bad device mmc 1 **
I know it is a timeout error and I also know that the error occurs inside mmc-uclass line 31. I'm aware send_cmd() is defined in mmc.h but I honestly don't know how to dig deeper into this error.
mmc info works fine. Here's the mmc rescan log if it makes any use: => mmc rescan CMD_SEND:0 ARG 0x00000000 MMC_RSP_NONE CMD_SEND:8 ARG 0x000001AA RET -110 CMD_SEND:55 ARG 0x00000000 RET -110 CMD_SEND:0 ARG 0x00000000 MMC_RSP_NONE CMD_SEND:1 ARG 0x00000000 MMC_RSP_R3,4 0x00FF8080 CMD_SEND:1 ARG 0x40360080 MMC_RSP_R3,4 0xC0FF8080 CMD_SEND:2 ARG 0x00000000 MMC_RSP_R2 0xEB010D65 0x4D4D4320 0x205000AC 0x008E7300
DUMPING DATA 000 - EB 01 0D 65 004 - 4D 4D 43 20 008 - 20 50 00 AC 012 - 00 8E 73 00 CMD_SEND:3 ARG 0x00010000 MMC_RSP_R1,5,6,7 0x00000500 CMD_SEND:9 ARG 0x00010000 MMC_RSP_R2 0xD04F0132 0x0F5903FF 0xFFFFFFEF 0x8A400000
DUMPING DATA 000 - D0 4F 01 32 004 - 0F 59 03 FF 008 - FF FF FF EF 012 - 8A 40 00 00 CMD_SEND:13 ARG 0x00010000 MMC_RSP_R1,5,6,7 0x00000700 CURR STATE:3 CMD_SEND:7 ARG 0x00010000 MMC_RSP_R1,5,6,7 0x00000700 CMD_SEND:8 ARG 0x00000000 MMC_RSP_R1,5,6,7 0x00000900 CMD_SEND:8 ARG 0x00000000 MMC_RSP_R1,5,6,7 0x00000900 CMD_SEND:6 ARG 0x03B90100 MMC_RSP_R1b 0x00000800 CMD_SEND:13 ARG 0x00010000 MMC_RSP_R1,5,6,7 0x00000900 CURR STATE:4 CMD_SEND:8 ARG 0x00000000 MMC_RSP_R1,5,6,7 0x00000900 CMD_SEND:6 ARG 0x03B70100 MMC_RSP_R1b 0x00000800 CMD_SEND:13 ARG 0x00010000 MMC_RSP_R1,5,6,7 0x00000900 CURR STATE:4 CMD_SEND:8 ARG 0x00000000 MMC_RSP_R1,5,6,7 0x00000900 CMD_SEND:16 ARG 0x00000200 MMC_RSP_R1,5,6,7 0x00000900 CMD_SEND:17 ARG 0x00000000 MMC_RSP_R1,5,6,7 0x00000900
Any guidance would be appreciated.
Please check if there is a pin conflict to configure, or if the mmc sequential number is correct.
On sama5d2 Xplained board, the eMMC works with the commands,
=> mmc info Device: sdio-host@a0000000 Manufacturer ID: fe OEM: 14e Name: MMC04 Tran Speed: 52000000 Rd Block Len: 512 MMC version 4.4.1 High Capacity: Yes Capacity: 3.7 GiB Bus Width: 4-bit Erase Group Size: 512 KiB HC WP Group Size: 4 MiB User Capacity: 3.7 GiB Boot Capacity: 1 MiB ENH RPMB Capacity: 128 KiB ENH
Thank you.
On Wed, Feb 14, 2018 at 3:27 PM, Mariano Coromac <mcoromac@stsa.info mailto:mcoromac@stsa.info> wrote:
Forget it guys, I just realized what was wrong. reg = <0xf8038200 0x200>; Before it was reg = <0xf8038200 0x100>; So if anyone else (that wants to use the flexcom uart) asks you about this now there's another thing you can point to. If I encounter another problem or something I'll get back to you.
-- Mariano Coromac https://gps.gt/ I&D of Electronics Engineer mcoromac@stsa.info mailto:mcoromac@stsa.info +502 41544712 www.gps.gt http://www.gps.gt http://facebook.com/startracksa
Best Regards, Wenyou Yang

Hmmm, by sequential number do you mean the Specification Version? This one is correct. Here's my eMMC info. => mmc info Device: sdio-host@a0000000 Manufacturer ID: eb OEM: 10d Name: eMMC Tran Speed: 52000000 Rd Block Len: 512 MMC version 5.0 High Capacity: Yes Capacity: 3.6 GiB Bus Width: 4-bit Erase Group Size: 512 KiB HC WP Group Size: 8 MiB User Capacity: 3.6 GiB Boot Capacity: 2 MiB ENH RPMB Capacity: 512 KiB ENH

On 2018/2/28 0:55, Mariano Coromac wrote:
Hmmm, by sequential number do you mean the Specification Version? This one is correct. Here's my eMMC info. => mmc info Device: sdio-host@a0000000 Manufacturer ID: eb OEM: 10d Name: eMMC Tran Speed: 52000000 Rd Block Len: 512 MMC version 5.0 High Capacity: Yes Capacity: 3.6 GiB Bus Width: 4-bit Erase Group Size: 512 KiB HC WP Group Size: 8 MiB User Capacity: 3.6 GiB Boot Capacity: 2 MiB ENH RPMB Capacity: 512 KiB ENH
This is right, did you try the command, => mmc read addr blk# cnt does it work?
Best Regards, Wenyou Yang

Yes, for example I did: => mmc read 0x00000000 512 1
MMC read: dev # 0, block # 1298, count 1 ... CMD_SEND:16 ARG 0x00000200 MMC_RSP_R1,5,6,7 0x00000900 CMD_SEND:17 ARG 0x00000512 MMC_RSP_R1,5,6,7 0x00000900 1 blocks read: OK
Then I tried to write into it like this: => mmc write 0x00000000 512 1
MMC write: dev # 0, block # 1298, count 1 ... CMD_SEND:16 ARG 0x00000200 MMC_RSP_R1,5,6,7 0x00000900 CMD_SEND:24 ARG 0x00000512 MMC_RSP_R1,5,6,7 0x00000900 CMD_SEND:13 ARG 0x00010000 sdhci_send_command: MMC: 0 busy timeout increasing to: 200 ms. MMC_RSP_R1,5,6,7 0x00000900 CURR STATE:4 1 blocks written: OK
What do you think? I'm reading JEDEC Specification Version 5.0 document maybe it could bring some insight on what is happening. The driver is supposed to match with any eMMC but still.
On Tue, Feb 27, 2018 at 7:24 PM, Yang, Wenyou Wenyou.Yang@microchip.com wrote:
On 2018/2/28 0:55, Mariano Coromac wrote:
Hmmm, by sequential number do you mean the Specification Version? This one is correct. Here's my eMMC info. => mmc info Device: sdio-host@a0000000 Manufacturer ID: eb OEM: 10d Name: eMMC Tran Speed: 52000000 Rd Block Len: 512 MMC version 5.0 High Capacity: Yes Capacity: 3.6 GiB Bus Width: 4-bit Erase Group Size: 512 KiB HC WP Group Size: 8 MiB User Capacity: 3.6 GiB Boot Capacity: 2 MiB ENH RPMB Capacity: 512 KiB ENH
This is right, did you try the command, => mmc read addr blk# cnt does it work?
Best Regards, Wenyou Yang

I found the problem. In my header file I was reading from eMMC device 1. Not 0. That's why the operations with mmc worked in command line but did not on startup. Please correct me if I'm mistaken but I have a couple questions. 1) Do I need a partition in my eMMC in order to boot the Linux kernel? When I run "mmc part" it shows no partition at all. 2) When U-Boot finishes compiling it generates a .dtb with the name of my custom board. I need to write this file (alongside zImage) inside my eMMC for my Linux Kernel to boot right? When I try to boot the kernel it hangs in here: => boot reading p_a5_tab_reva.dtb 13699 bytes read in 18 ms (743.2 KiB/s) reading zImage 3749624 bytes read in 298 ms (12 MiB/s) ## Flattened Device Tree blob at 21000000 Booting using the fdt blob at 0x21000000 Loading Device Tree to 27b7d000, end 27b83582 ... OK
Starting kernel ...
What do you think of this? Perhaps is regarding the kernel itself or maybe is a UBoot configuration?

Hi,
On Thu, 1 Mar 2018 13:55:19 -0600 Mariano Coromac wrote:
I found the problem. In my header file I was reading from eMMC device 1. Not 0. That's why the operations with mmc worked in command line but did not on startup. Please correct me if I'm mistaken but I have a couple questions.
- Do I need a partition in my eMMC in order to boot the Linux kernel?
When I run "mmc part" it shows no partition at all. 2) When U-Boot finishes compiling it generates a .dtb with the name of my custom board. I need to write this file (alongside zImage) inside my eMMC for my Linux Kernel to boot right? When I try to boot the kernel it hangs in here: => boot reading p_a5_tab_reva.dtb 13699 bytes read in 18 ms (743.2 KiB/s) reading zImage 3749624 bytes read in 298 ms (12 MiB/s) ## Flattened Device Tree blob at 21000000 Booting using the fdt blob at 0x21000000 Loading Device Tree to 27b7d000, end 27b83582 ... OK
Starting kernel ...
What do you think of this? Perhaps is regarding the kernel itself or maybe is a UBoot configuration?
My guess is that the fdt is out of reach for the kernel. Try setting the fdt_high variable to limit the range where U-Boot will copy the fdt. fdt_high=ffffffff will prevent copying the fdt at all, other values specify the upper limit for the memory address where the fdt will end after copying.
Lothar Waßmann

On 01/03/2018 at 20:55, Mariano Coromac wrote:
I found the problem. In my header file I was reading from eMMC device 1. Not 0. That's why the operations with mmc worked in command line but did not on startup. Please correct me if I'm mistaken but I have a couple questions.
- Do I need a partition in my eMMC in order to boot the Linux kernel?
When I run "mmc part" it shows no partition at all. 2) When U-Boot finishes compiling it generates a .dtb with the name of my custom board. I need to write this file (alongside zImage) inside my eMMC for my Linux Kernel to boot right?
Actually no: the .dtb from U-Boot is for U-Boot to use. For loading the Linux kernel, you must use the .dtb that is produced by the compilation of the kernel (in arch/arm/boot/dts/)
When I try to boot the kernel it hangs in here: => boot reading p_a5_tab_reva.dtb 13699 bytes read in 18 ms (743.2 KiB/s) reading zImage 3749624 bytes read in 298 ms (12 MiB/s) ## Flattened Device Tree blob at 21000000 Booting using the fdt blob at 0x21000000 Loading Device Tree to 27b7d000, end 27b83582 ... OK
Starting kernel ...
What do you think of this? Perhaps is regarding the kernel itself or maybe is a UBoot configuration?

I changed fdt_high but got the same result. I wrote my device tree, added it into the makefile and copy the sama5d2.config with my board name. I also got rid of all the unnecessary stuff. I'm now using the correct .dtb file (in arch/arm/boot/dts/) My device tree stdout-path does point into my flexcom1 serial port. Do you see something wrong? flx1: flexcom@f8038000 { atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>; status = "okay";
uart5: serial@200 { compatible = "atmel,at91sam9260-usart"; reg = <0x200 0x200>; interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>; #address-cells = <1>; #size-cells = <0>; clocks = <&flx0_clk>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_flx0_default>; atmel,fifo-size = <16>; status = "okay"; }; }; Here's a new log if it is of any use: AT91Bootstrap 3.8.9-00026-gd7a52fb-dirty (mié feb 21 10:03:49 CST 2018)
SD/MMC: Image: Read file u-boot.bin to 0x26f00000 MMC: Specification Version 1.2 SD/MMC: Done to load image <debug_uart> MMC: sdio-host@a0000000: 0
** Unable to use mmc 0:1 for loading the env ** Using default environment
In: serial@f8038200 Out: serial@f8038200 Err: serial@f8038200 stdin stdout stderr Hit any key to stop autoboot: 0 reading p_a5_tab_reva.dtb 26135 bytes read in 18 ms (1.4 MiB/s) reading zImage 2452336 bytes read in 198 ms (11.8 MiB/s) ## Current stack ends at 0x27b84588 * kernel: cmdline image address = 0x22000000 ## Flattened Device Tree blob at 21000000 Booting using the fdt blob at 0x21000000 using: FDT Loading Device Tree to 27b79000, end 27b82616 ... OK ## Transferring control to Linux (at address 22000000)...
Starting kernel ...
As my understanding goes those are the only things I need, my device tree and the linux image. I think my main problem is that I don't have the console in my serial port, that's why it appears like it hangs but I'm not so sure about that. I also defined the following inside my config file: CONFIG_DEBUG_UART_PHYS=0xf8038200 CONFIG_DEBUG_UART_VIRT=0xf7038200
Any help would be appreciated.
On Fri, Mar 2, 2018 at 11:58 AM, Nicolas Ferre nicolas.ferre@microchip.com wrote:
On 01/03/2018 at 20:55, Mariano Coromac wrote:
I found the problem. In my header file I was reading from eMMC device 1. Not 0. That's why the operations with mmc worked in command line but did not on startup. Please correct me if I'm mistaken but I have a couple questions.
- Do I need a partition in my eMMC in order to boot the Linux kernel?
When I run "mmc part" it shows no partition at all. 2) When U-Boot finishes compiling it generates a .dtb with the name of my custom board. I need to write this file (alongside zImage) inside my eMMC for my Linux Kernel to boot right?
Actually no: the .dtb from U-Boot is for U-Boot to use. For loading the Linux kernel, you must use the .dtb that is produced by the compilation of the kernel (in arch/arm/boot/dts/)
When I try to boot the kernel it hangs in here:
=> boot reading p_a5_tab_reva.dtb 13699 bytes read in 18 ms (743.2 KiB/s) reading zImage 3749624 bytes read in 298 ms (12 MiB/s) ## Flattened Device Tree blob at 21000000 Booting using the fdt blob at 0x21000000 Loading Device Tree to 27b7d000, end 27b83582 ... OK
Starting kernel ...
What do you think of this? Perhaps is regarding the kernel itself or maybe is a UBoot configuration?
-- Nicolas Ferre
participants (6)
-
Lothar Waßmann
-
Marek Vasut
-
Mariano Coromac
-
Nicolas Ferre
-
Simon Glass
-
Yang, Wenyou