Skip to contentSkip to conversation

Odroid n2 using eMMC would fail to boot up

PATCH Superseded Anand Moon 3 participants 17 messages Nov 26, 2019 – Dec 21, 2019

Subsystems (4)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Anand Moon

author
#0 lore raw

cover Odroid n2 using eMMC would fail to boot up

Here are some small changes to fix booting of Odroid N2

Tested on below eMMC module
new orange - eMMC AJNB4R 14.6 GiB MMC 5.1
old back - eMMC CGND3R 58.2 GiB MMC 5.0

-Anand

Anand Moon (4):
mmc: meson-gx: Fix tx phase in the tuning process
configs: meson64: enable GIC support for G12A/G12B
board: amlogic: select PWRSEQ for all amlogic platform
board: amlogic: Add missing config option

 arch/arm/mach-meson/Kconfig | 1 +
 configs/nanopi-k2_defconfig | 2 ++
 configs/odroid-c2_defconfig | 2 ++
 drivers/mmc/meson_gx_mmc.c  | 2 +-
 include/configs/meson64.h   | 2 +-
 5 files changed, 7 insertions(+), 2 deletions(-)
Signature · 1 line
2.24.0
author
#1 lore raw

PATCH 1/4 mmc: meson-gx: Fix tx phase in the tuning process

odroid n2 eMMC module would failed to boot up,
because of TX phase clk failure, fix the typo in
TX phase macro to help tune correct clk freqency.

Before these changes.
clock is enabled (380953Hz)
clock is enabled (25000000Hz)
after these changes
clock is enabled (380953Hz)
clock is enabled (25000000Hz)
clock is enabled (52000000Hz)
clock is enabled (52000000Hz)
clock is enabled (52000000Hz)

---
Tested on
new orange - eMMC AJNB4R 14.6 GiB MMC 5.1
old back - eMMC CGND3R 58.2 GiB MMC 5.0

---
 drivers/mmc/meson_gx_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/meson_gx_mmc.c +1 -1
index 031cc79ccb..87bea2888b 100644
@@ -53,7 +53,7 @@ static void meson_mmc_config_clock(struct mmc *mmc)
 	meson_mmc_clk |= CLK_CO_PHASE_180;
 
 	/* 180 phase tx clock */
-	meson_mmc_clk |= CLK_TX_PHASE_000;
+	meson_mmc_clk |= CLK_TX_PHASE_180;
 
 	/* clock settings */
 	meson_mmc_clk |= clk_src;
Signature · 1 line
2.24.0
#2 lore raw

PATCH 1/4 mmc: meson-gx: Fix tx phase in the tuning process

Hi,

Quoted 29 lines · Anand Moon

odroid n2 eMMC module would failed to boot up,
because of TX phase clk failure, fix the typo in
TX phase macro to help tune correct clk freqency.

Before these changes.
clock is enabled (380953Hz)
clock is enabled (25000000Hz)
after these changes
clock is enabled (380953Hz)
clock is enabled (25000000Hz)
clock is enabled (52000000Hz)
clock is enabled (52000000Hz)
clock is enabled (52000000Hz)

---
Tested on
new orange - eMMC AJNB4R 14.6 GiB MMC 5.1
old back - eMMC CGND3R 58.2 GiB MMC 5.0

---
 drivers/mmc/meson_gx_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/meson_gx_mmc.c +0 -0
index 031cc79ccb..87bea2888b 100644

drivers/mmc/meson_gx_mmc.c static void meson_mmc_config_clock(struct mmc *mmc) · line 59

Quoted 8 lines
drivers/mmc/meson_gx_mmc.c +1 -1
@@ -53,7 +53,7 @@ static void meson_mmc_config_clock(struct mmc *mmc)
 	meson_mmc_clk |= CLK_CO_PHASE_180;
 
 	/* 180 phase tx clock */
-	meson_mmc_clk |= CLK_TX_PHASE_000;
+	meson_mmc_clk |= CLK_TX_PHASE_180;
 
 	/* clock settings */
 	meson_mmc_clk |= clk_src;

I don't understand what this change helps, the linux driver sets the TX phase to 0, why 180 would help here ?

Neil

author
#3 lore raw

PATCH 1/4 mmc: meson-gx: Fix tx phase in the tuning process

Hi Neil,

Quoted 38 lines · Neil Armstrong

Hi,

Quoted 34 lines · Anand Moon

odroid n2 eMMC module would failed to boot up,
because of TX phase clk failure, fix the typo in
TX phase macro to help tune correct clk freqency.

Before these changes.
clock is enabled (380953Hz)
clock is enabled (25000000Hz)
after these changes
clock is enabled (380953Hz)
clock is enabled (25000000Hz)
clock is enabled (52000000Hz)
clock is enabled (52000000Hz)
clock is enabled (52000000Hz)

---
Tested on
new orange - eMMC AJNB4R 14.6 GiB MMC 5.1
old back - eMMC CGND3R 58.2 GiB MMC 5.0

---
 drivers/mmc/meson_gx_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/meson_gx_mmc.c +1 -1
index 031cc79ccb..87bea2888b 100644
@@ -53,7 +53,7 @@ static void meson_mmc_config_clock(struct mmc *mmc)
      meson_mmc_clk |= CLK_CO_PHASE_180;
 
      /* 180 phase tx clock */
-     meson_mmc_clk |= CLK_TX_PHASE_000;
+     meson_mmc_clk |= CLK_TX_PHASE_180;
 
Quoted 8 lines

drivers/mmc/meson_gx_mmc.c static void meson_mmc_config_clock(struct mmc *mmc) · line 59

Quoted 3 lines
drivers/mmc/meson_gx_mmc.c +0 -0
      /* clock settings */
      meson_mmc_clk |= clk_src;

I don't understand what this change helps, the linux driver sets the TX phase to 0, why 180 would help here ?

Neil

I narrow down to this small changes, without this small change it fails to detect the eMMC module. See the below log.

U-Boot 2020.01-rc3-00082-g4b19b89ca4-dirty (Nov 27 2019 - 18:56:37 +0530) odroid-n2

Model: Hardkernel ODROID-N2
SoC:   Amlogic Meson G12B (S922X) Revision 29:a (40:2)
DRAM:  3.8 GiB
mmc_bind: alias ret=-2, devnum=-1
mmc_bind: alias ret=-2, devnum=-1
MMC:   clock is enabled (380953Hz)
clock is enabled (380953Hz)
sd at ffe05000: 0, mmc at ffe07000: 1
In:    serial at 3000
Out:   serial at 3000
Err:   serial at 3000
Net:   gpio_request_tail: Node 'ethernet at ff3f0000', property

'snps,reset-gpio', failed to request GPIO index 0: -2

Warning: ethernet at ff3f0000 (eth0) using random MAC address - 26:1e:2a:2a:67:d6
eth0: ethernet at ff3f0000
Hit any key to stop autoboot: 0
clock is disabled (0Hz)
regulator_common_set_enable: dev='regulator-tflash_vdd', enable=1, delay=0, has_gpio=1
regulator_common_set_enable: done
clock is enabled (380953Hz)
Card did not respond to voltage select!
gpio_request_tail: Node 'regulator-vcc_3v3', property 'gpio', failed to request GPIO index 0: -2
Regulator 'regulator-vcc_3v3' optional enable GPIO - not found! Error: -2
gpio_request_tail: Node 'regulator-flash_1v8', property 'gpio', failed to request GPIO index 0: -2
Regulator 'regulator-flash_1v8' optional enable GPIO - not found! Error: -2 clock is disabled (0Hz)
regulator_common_set_enable: dev='regulator-vcc_3v3', enable=1, delay=0, has_gpio=0
clock is enabled (380953Hz)
clock is enabled (25000000Hz)
unable to select a mode
switch to partitions #0, OK
mmc1(part 0) is current device
** No partition table - mmc 1 **
MMC Device 2 not found
no mmc device at slot 2
starting USB...
Bus usb at ff500000: gpio_request_tail: Node 'regulator-vcc_5v', property 'gpio', failed to request GPIO index 0: -2
Regulator 'regulator-vcc_5v' optional enable GPIO - not found! Error: -2 regulator_common_set_enable: dev='regulator-usb_pwr_en', enable=1, delay=0, has_gpio=1
regulator_common_set_enable: done
Register 3000140 NbrPorts 3
Starting the controller
USB XHCI 1.10
scanning bus usb at ff500000 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found

-Anand

#4 lore raw

PATCH 1/4 mmc: meson-gx: Fix tx phase in the tuning process

Hi,

Quoted 100 lines · Anand Moon

Hi Neil,

Quoted 38 lines · Neil Armstrong

Hi,

Quoted 34 lines · Anand Moon

odroid n2 eMMC module would failed to boot up,
because of TX phase clk failure, fix the typo in
TX phase macro to help tune correct clk freqency.

Before these changes.
clock is enabled (380953Hz)
clock is enabled (25000000Hz)
after these changes
clock is enabled (380953Hz)
clock is enabled (25000000Hz)
clock is enabled (52000000Hz)
clock is enabled (52000000Hz)
clock is enabled (52000000Hz)

---
Tested on
new orange - eMMC AJNB4R 14.6 GiB MMC 5.1
old back - eMMC CGND3R 58.2 GiB MMC 5.0

---
 drivers/mmc/meson_gx_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/meson_gx_mmc.c +1 -1
index 031cc79ccb..87bea2888b 100644
@@ -53,7 +53,7 @@ static void meson_mmc_config_clock(struct mmc *mmc)
      meson_mmc_clk |= CLK_CO_PHASE_180;
 
      /* 180 phase tx clock */
-     meson_mmc_clk |= CLK_TX_PHASE_000;
+     meson_mmc_clk |= CLK_TX_PHASE_180;
 
Quoted 8 lines

drivers/mmc/meson_gx_mmc.c static void meson_mmc_config_clock(struct mmc *mmc) · line 59

Quoted 3 lines
drivers/mmc/meson_gx_mmc.c +0 -0
      /* clock settings */
      meson_mmc_clk |= clk_src;

I don't understand what this change helps, the linux driver sets the TX phase to 0, why 180 would help here ?

Neil

I narrow down to this small changes, without this small change it fails to detect the eMMC module. See the below log.

U-Boot 2020.01-rc3-00082-g4b19b89ca4-dirty (Nov 27 2019 - 18:56:37 +0530) odroid-n2

Model: Hardkernel ODROID-N2
SoC:   Amlogic Meson G12B (S922X) Revision 29:a (40:2)
DRAM:  3.8 GiB
mmc_bind: alias ret=-2, devnum=-1
mmc_bind: alias ret=-2, devnum=-1
MMC:   clock is enabled (380953Hz)
clock is enabled (380953Hz)
sd at ffe05000: 0, mmc at ffe07000: 1
In:    serial at 3000
Out:   serial at 3000
Err:   serial at 3000
Net:   gpio_request_tail: Node 'ethernet at ff3f0000', property

'snps,reset-gpio', failed to request GPIO index 0: -2

Warning: ethernet at ff3f0000 (eth0) using random MAC address - 26:1e:2a:2a:67:d6
eth0: ethernet at ff3f0000
Hit any key to stop autoboot: 0
clock is disabled (0Hz)
regulator_common_set_enable: dev='regulator-tflash_vdd', enable=1, delay=0, has_gpio=1
regulator_common_set_enable: done
clock is enabled (380953Hz)
Card did not respond to voltage select!
gpio_request_tail: Node 'regulator-vcc_3v3', property 'gpio', failed to request GPIO index 0: -2
Regulator 'regulator-vcc_3v3' optional enable GPIO - not found! Error: -2
gpio_request_tail: Node 'regulator-flash_1v8', property 'gpio', failed to request GPIO index 0: -2
Regulator 'regulator-flash_1v8' optional enable GPIO - not found! Error: -2 clock is disabled (0Hz)
regulator_common_set_enable: dev='regulator-vcc_3v3', enable=1, delay=0, has_gpio=0
clock is enabled (380953Hz)
clock is enabled (25000000Hz)
unable to select a mode
switch to partitions #0, OK
mmc1(part 0) is current device
** No partition table - mmc 1 **
MMC Device 2 not found
no mmc device at slot 2
starting USB...
Bus usb at ff500000: gpio_request_tail: Node 'regulator-vcc_5v', property 'gpio', failed to request GPIO index 0: -2
Regulator 'regulator-vcc_5v' optional enable GPIO - not found! Error: -2

Quoted 8 lines

regulator_common_set_enable: dev='regulator-usb_pwr_en', enable=1, delay=0, has_gpio=1
regulator_common_set_enable: done
Register 3000140 NbrPorts 3
Starting the controller
USB XHCI 1.10
scanning bus usb at ff500000 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found

I have the same behavior with SEI610 on SM1, I need to check this fixes the issue...

Neil

Quoted 3 lines

-Anand

#5 lore raw

PATCH 1/4 mmc: meson-gx: Fix tx phase in the tuning process

Hi Anand,

Quoted 112 lines · Neil Armstrong

Hi,

Quoted 100 lines · Anand Moon

Hi Neil,

Quoted 38 lines · Neil Armstrong

Hi,

Quoted 34 lines · Anand Moon

odroid n2 eMMC module would failed to boot up,
because of TX phase clk failure, fix the typo in
TX phase macro to help tune correct clk freqency.

Before these changes.
clock is enabled (380953Hz)
clock is enabled (25000000Hz)
after these changes
clock is enabled (380953Hz)
clock is enabled (25000000Hz)
clock is enabled (52000000Hz)
clock is enabled (52000000Hz)
clock is enabled (52000000Hz)

---
Tested on
new orange - eMMC AJNB4R 14.6 GiB MMC 5.1
old back - eMMC CGND3R 58.2 GiB MMC 5.0

---
 drivers/mmc/meson_gx_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/meson_gx_mmc.c +1 -1
index 031cc79ccb..87bea2888b 100644
@@ -53,7 +53,7 @@ static void meson_mmc_config_clock(struct mmc *mmc)
      meson_mmc_clk |= CLK_CO_PHASE_180;
 
      /* 180 phase tx clock */
-     meson_mmc_clk |= CLK_TX_PHASE_000;
+     meson_mmc_clk |= CLK_TX_PHASE_180;
 
Quoted 8 lines

drivers/mmc/meson_gx_mmc.c static void meson_mmc_config_clock(struct mmc *mmc) · line 59

Quoted 3 lines
drivers/mmc/meson_gx_mmc.c +0 -0
      /* clock settings */
      meson_mmc_clk |= clk_src;

I don't understand what this change helps, the linux driver sets the TX phase to 0, why 180 would help here ?

Neil

I narrow down to this small changes, without this small change it fails to detect the eMMC module. See the below log.

U-Boot 2020.01-rc3-00082-g4b19b89ca4-dirty (Nov 27 2019 - 18:56:37 +0530) odroid-n2

Model: Hardkernel ODROID-N2
SoC:   Amlogic Meson G12B (S922X) Revision 29:a (40:2)
DRAM:  3.8 GiB
mmc_bind: alias ret=-2, devnum=-1
mmc_bind: alias ret=-2, devnum=-1
MMC:   clock is enabled (380953Hz)
clock is enabled (380953Hz)
sd at ffe05000: 0, mmc at ffe07000: 1
In:    serial at 3000
Out:   serial at 3000
Err:   serial at 3000
Net:   gpio_request_tail: Node 'ethernet at ff3f0000', property

'snps,reset-gpio', failed to request GPIO index 0: -2

Warning: ethernet at ff3f0000 (eth0) using random MAC address - 26:1e:2a:2a:67:d6
eth0: ethernet at ff3f0000
Hit any key to stop autoboot: 0
clock is disabled (0Hz)
regulator_common_set_enable: dev='regulator-tflash_vdd', enable=1, delay=0, has_gpio=1
regulator_common_set_enable: done
clock is enabled (380953Hz)
Card did not respond to voltage select!
gpio_request_tail: Node 'regulator-vcc_3v3', property 'gpio', failed to request GPIO index 0: -2
Regulator 'regulator-vcc_3v3' optional enable GPIO - not found! Error: -2
gpio_request_tail: Node 'regulator-flash_1v8', property 'gpio', failed to request GPIO index 0: -2
Regulator 'regulator-flash_1v8' optional enable GPIO - not found! Error: -2 clock is disabled (0Hz)
regulator_common_set_enable: dev='regulator-vcc_3v3', enable=1, delay=0, has_gpio=0
clock is enabled (380953Hz)
clock is enabled (25000000Hz)
unable to select a mode
switch to partitions #0, OK
mmc1(part 0) is current device
** No partition table - mmc 1 **
MMC Device 2 not found
no mmc device at slot 2
starting USB...
Bus usb at ff500000: gpio_request_tail: Node 'regulator-vcc_5v', property 'gpio', failed to request GPIO index 0: -2
Regulator 'regulator-vcc_5v' optional enable GPIO - not found! Error: -2

Quoted 8 lines

regulator_common_set_enable: dev='regulator-usb_pwr_en', enable=1, delay=0, has_gpio=1
regulator_common_set_enable: done
Register 3000140 NbrPorts 3
Starting the controller
USB XHCI 1.10
scanning bus usb at ff500000 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found

Quoted 1 line

I have the same behavior with SEI610 on SM1, I need to check this fixes the issue...

Could you try the following patches instead of this one ?

https://patchwork.ozlabs.org/patch/1213648/
https://patchwork.ozlabs.org/patch/1213650/

Neil

Quoted 7 lines

Neil

Quoted 3 lines

-Anand

author
#7 lore raw

PATCH 1/4 mmc: meson-gx: Fix tx phase in the tuning process

Hi Neil, + Jerome,

Quoted 12 lines · Anand Moon

Hi Neil,

Quoted 5 lines

Could you try the following patches instead of this one ?

https://patchwork.ozlabs.org/patch/1213648/
https://patchwork.ozlabs.org/patch/1213650/

Yes I have tried this series it worked for me. It's much better fix than my approach.

Looks like I did some wrong testing, with microSD card connected, I missed that. For me at this point this issue persist. Here is the logs below.

emmc switch 1 ok
00000000
emmc switch 2 ok
fastboot data verify
verify result: 255
Cfg max: 1, cur: 1. Board id: 255. Force loop cfg DDR4 probe
ddr clk to 1320MHz
Load ddrfw from eMMC, src: 0x00014200, des: 0xfffd0000, size:
0x0000c000, part: 0
00000000
emmc switch 0 ok
Check phy result
INFO : End of initialization
INFO : End of read enable training
INFO : End of fine write leveling
INFO : End of read dq deskew training
INFO : End of MPR read delay center optimization INFO : End of Write leveling coarse delay
INFO : End of write delay center optimization
INFO : End of read delay center optimization
INFO : End of max read latency training
INFO : Training has run successfully!
1D training succeed
Load ddrfw from eMMC, src: 0x00020200, des: 0xfffd0000, size:
0x0000c000, part: 0
Check phy result
INFO : End of initialization
INFO : End of 2D read delay Voltage center optimization INFO : End of 2D write delay Voltage center optimization INFO : Training has run successfully!

R0_RxClkDly_Margin==82 ps 7
R0_TxDqDly_Margi==106 ps 9

R1_RxClkDly_Margin==0 ps 0
R1_TxDqDly_Margi==0 ps 0

dwc_ddrphy_apb_wr((0<<20)|(2<<16)|(0<<12)|(0xb0):0001
2D training succeed
auto size-- 65535DDR cs0 size: 2048MB
DDR cs1 size: 2048MB
DMC_DDR_CTRL: 00600024DDR size: 3928MB
cs0 DataBus test pass
cs1 DataBus test pass
cs0 AddrBus test pass
cs1 AddrBus test pass
pre test bdlr_100_average==435 bdlr_100_min==435 bdlr_100_max==435
bdlr_100_cur==435
aft test bdlr_100_average==435 bdlr_100_min==435 bdlr_100_max==435
bdlr_100_cur==435
non-sec scramble use zero key
ddr scramble enabled

100bdlr_step_size ps== 435
result report
boot times 2Enable ddr reg access
00000000
emmc switch 3 ok
Authentication key not yet programmed
get rpmb counter error 0x00000007
00000000
emmc switch 0 ok
Load FIP HDR from eMMC, src: 0x00010200, des: 0x01700000, size:
0x00004000, part: 0
Load BL3X from eMMC, src: 0x0006c200, des: 0x0175c000, size: 0x00088200, part: 0 0.0;M3 CHK:0;cm4_sp_mode 0
E30HDR
MVN_1=0x00000000
MVN_2=0x00000000
[Image: g12b_v1.1.3375-8f9c8a7 2019-01-24 10:44:46 guotai.shen at droid11-sz] OPS=0x40
ring efuse init
chipver efuse init
29 0a 40 00 01 20 10 00 00 15 30 32 54 52 4d 50
[3.472682 Inits done]
secure task start!
high task start!
low task start!
run into bl31

NOTICE:  BL31: v1.3(release):ab8811b
NOTICE:  BL31: Built : 15:03:31, Feb 12 2019
NOTICE:  BL31: G12A normal boot!
NOTICE:  BL31: BL33 decompress pass
ERROR:   Error initializing runtime service opteed_fast

U-Boot 2020.01-rc5-00009-g269c6e8c39 (Dec 20 2019 - 15:38:58 +0530) odroid-n2

Model: Hardkernel ODROID-N2
SoC:   Amlogic Meson G12B (S922X) Revision 29:a (40:2)
DRAM:  3.8 GiB
MMC:   sd at ffe05000: 0, mmc at ffe07000: 1
In:    serial at 3000
Out:   serial at 3000
Err:   serial at 3000

Net:
Warning: ethernet at ff3f0000 (eth0) using random MAC address - 4a:ab:15:ba:29:62
eth0: ethernet at ff3f0000
Hit any key to stop autoboot: 0
Card did not respond to voltage select!
unable to select a mode
switch to partitions #0, OK
mmc1(part 0) is current device
** No partition table - mmc 1 **
MMC Device 2 not found
no mmc device at slot 2
starting USB...
Bus usb at ff500000: Register 3000140 NbrPorts 3
Starting the controller
USB XHCI 1.10
scanning bus usb@ff500000 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found

complete logs in below linked.
[0] http://pastebin.com/UsVMYAvW

-Anand

reviewer
#8 lore raw

PATCH 1/4 mmc: meson-gx: Fix tx phase in the tuning process

Quoted 134 lines · Anand Moon

Hi Neil, + Jerome,

Quoted 12 lines · Anand Moon

Hi Neil,

Quoted 5 lines

Could you try the following patches instead of this one ?

https://patchwork.ozlabs.org/patch/1213648/
https://patchwork.ozlabs.org/patch/1213650/

Yes I have tried this series it worked for me. It's much better fix than my approach.

Looks like I did some wrong testing, with microSD card connected, I missed that. For me at this point this issue persist. Here is the logs below.

emmc switch 1 ok
00000000
emmc switch 2 ok
fastboot data verify
verify result: 255
Cfg max: 1, cur: 1. Board id: 255. Force loop cfg DDR4 probe
ddr clk to 1320MHz
Load ddrfw from eMMC, src: 0x00014200, des: 0xfffd0000, size:
0x0000c000, part: 0
00000000
emmc switch 0 ok
Check phy result
INFO : End of initialization
INFO : End of read enable training
INFO : End of fine write leveling
INFO : End of read dq deskew training
INFO : End of MPR read delay center optimization INFO : End of Write leveling coarse delay
INFO : End of write delay center optimization
INFO : End of read delay center optimization
INFO : End of max read latency training
INFO : Training has run successfully!
1D training succeed
Load ddrfw from eMMC, src: 0x00020200, des: 0xfffd0000, size:
0x0000c000, part: 0
Check phy result
INFO : End of initialization
INFO : End of 2D read delay Voltage center optimization INFO : End of 2D write delay Voltage center optimization INFO : Training has run successfully!

R0_RxClkDly_Margin==82 ps 7
R0_TxDqDly_Margi==106 ps 9

R1_RxClkDly_Margin==0 ps 0
R1_TxDqDly_Margi==0 ps 0

dwc_ddrphy_apb_wr((0<<20)|(2<<16)|(0<<12)|(0xb0):0001
2D training succeed
auto size-- 65535DDR cs0 size: 2048MB
DDR cs1 size: 2048MB
DMC_DDR_CTRL: 00600024DDR size: 3928MB
cs0 DataBus test pass
cs1 DataBus test pass
cs0 AddrBus test pass
cs1 AddrBus test pass
pre test bdlr_100_average==435 bdlr_100_min==435 bdlr_100_max==435
bdlr_100_cur==435
aft test bdlr_100_average==435 bdlr_100_min==435 bdlr_100_max==435
bdlr_100_cur==435
non-sec scramble use zero key
ddr scramble enabled

100bdlr_step_size ps== 435
result report
boot times 2Enable ddr reg access
00000000
emmc switch 3 ok
Authentication key not yet programmed
get rpmb counter error 0x00000007
00000000
emmc switch 0 ok
Load FIP HDR from eMMC, src: 0x00010200, des: 0x01700000, size:
0x00004000, part: 0
Load BL3X from eMMC, src: 0x0006c200, des: 0x0175c000, size: 0x00088200, part: 0 0.0;M3 CHK:0;cm4_sp_mode 0
E30HDR
MVN_1=0x00000000
MVN_2=0x00000000
[Image: g12b_v1.1.3375-8f9c8a7 2019-01-24 10:44:46 guotai.shen at droid11-sz] OPS=0x40
ring efuse init
chipver efuse init
29 0a 40 00 01 20 10 00 00 15 30 32 54 52 4d 50
[3.472682 Inits done]
secure task start!
high task start!
low task start!
run into bl31

NOTICE:  BL31: v1.3(release):ab8811b
NOTICE:  BL31: Built : 15:03:31, Feb 12 2019
NOTICE:  BL31: G12A normal boot!
NOTICE:  BL31: BL33 decompress pass
ERROR:   Error initializing runtime service opteed_fast

U-Boot 2020.01-rc5-00009-g269c6e8c39 (Dec 20 2019 - 15:38:58 +0530) odroid-n2

Model: Hardkernel ODROID-N2
SoC:   Amlogic Meson G12B (S922X) Revision 29:a (40:2)
DRAM:  3.8 GiB
MMC:   sd at ffe05000: 0, mmc at ffe07000: 1
In:    serial at 3000
Out:   serial at 3000
Err:   serial at 3000

Net:
Warning: ethernet at ff3f0000 (eth0) using random MAC address - 4a:ab:15:ba:29:62
eth0: ethernet at ff3f0000
Hit any key to stop autoboot: 0
Card did not respond to voltage select!
unable to select a mode
switch to partitions #0, OK
mmc1(part 0) is current device
** No partition table - mmc 1 **
MMC Device 2 not found
no mmc device at slot 2
starting USB...
Bus usb at ff500000: Register 3000140 NbrPorts 3
Starting the controller
USB XHCI 1.10
scanning bus usb at ff500000 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found

Quoted 4 lines

complete logs in below linked.
[0] http://pastebin.com/UsVMYAvW

-Anand

I'm not quite sure I get what I should understand from this log.

I can comment on the original patch though.

I think you should keep the phase settings aligned with Linux.

A) Among the exchange I had with amlogic, I got that there should always be a phase shift of 180 degree between the core and Tx phase.

B) So far, Core=180, Tx=0, Rx=0 has proven to be quite stable for all the devices. I spent significant amount of time testing that.

If that's not the case for the N2 under linux, please report it to the related ML. If these settings works under Linux, then it is not the problem and I don't think you should change them in u-boot.

author
#9 lore raw

PATCH 1/4 mmc: meson-gx: Fix tx phase in the tuning process

Hi Jerome / Neil,

[...]

Quoted 7 lines

I'm not quite sure I get what I should understand from this log.

I can comment on the original patch though.

I think you should keep the phase settings aligned with Linux.

Thanks for this inputs.

Quoted 6 lines

A) Among the exchange I had with amlogic, I got that there should always be a phase shift of 180 degree between the core and Tx phase.

B) So far, Core=180, Tx=0, Rx=0 has proven to be quite stable for all the devices. I spent significant amount of time testing that.

I feel you are referring below in mainline kernel

#define   CLK_CORE_PHASE_MASK GENMASK(9, 8)
#define   CLK_TX_PHASE_MASK GENMASK(11, 10)
#define   CLK_RX_PHASE_MASK GENMASK(13, 12)
        /* init SD_EMMC_CLOCK to sane defaults w/min clock rate */
        clk_reg = CLK_ALWAYS_ON(host);
        clk_reg |= CLK_DIV_MASK;
        clk_reg |= FIELD_PREP(CLK_CORE_PHASE_MASK, CLK_PHASE_180);
        clk_reg |= FIELD_PREP(CLK_TX_PHASE_MASK, CLK_PHASE_0);
        clk_reg |= FIELD_PREP(CLK_RX_PHASE_MASK, CLK_PHASE_0);
        writel(clk_reg, host->regs + SD_EMMC_CLOCK);

So in the current u-boot host we are not setting the correct bits for clock tuning

I have modified with above changes and was able to boot into my Odorid N2 on emmc.
I will check this out on my Odroid C2 and sdcard and then submit the next version.

Quoted 3 lines

If that's not the case for the N2 under linux, please report it to the related ML. If these settings works under Linux, then it is not the problem and I don't think you should change them in u-boot.

----
clock is enabled (380953Hz)
clock is enabled (25000000Hz)
clock is enabled (52000000Hz)
switch to partitions #0, OK
mmc2(part 0) is current device
Scanning mmc 2:1...
Found U-Boot script /boot/boot.scr
745 bytes read in 1 ms (727.5 KiB/s)
## Executing script at 08000000
27445760 bytes read in 605 ms (43.3 MiB/s)
65829 bytes read in 3 ms (20.9 MiB/s)
7404738 bytes read in 164 ms (43.1 MiB/s)
## Flattened Device Tree blob at 08008000

-Anand

author
#10 lore raw

PATCH 2/4 configs: meson64: enable GIC support for G12A/G12B

In reply to Anand Moon

Enable GIC support for G12A/G12B platform.

---
 include/configs/meson64.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/meson64.h +1 -1
index 736081277d..50707a3197 100644
@@ -8,7 +8,7 @@
 #define __MESON64_CONFIG_H
 
 /* Generic Interrupt Controller Definitions */
-#if defined(CONFIG_MESON_AXG)
+#if (defined(CONFIG_MESON_AXG) || defined(CONFIG_MESON_G12A))
 #define GICD_BASE			0xffc01000
 #define GICC_BASE			0xffc02000
 #else /* MESON GXL and GXBB */
Signature · 1 line
2.24.0
#11 lore raw

PATCH 2/4 configs: meson64: enable GIC support for G12A/G12B

Quoted 13 lines · Anand Moon

Enable GIC support for G12A/G12B platform.

---
 include/configs/meson64.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/meson64.h +0 -0
index 736081277d..50707a3197 100644

include/configs/meson64.h line 14

Quoted 8 lines
include/configs/meson64.h +1 -1
@@ -8,7 +8,7 @@
 #define __MESON64_CONFIG_H
 
 /* Generic Interrupt Controller Definitions */
-#if defined(CONFIG_MESON_AXG)
+#if (defined(CONFIG_MESON_AXG) || defined(CONFIG_MESON_G12A))
 #define GICD_BASE			0xffc01000
 #define GICC_BASE			0xffc02000
 #else /* MESON GXL and GXBB */

Thanks for spotting this !

author
#12 lore raw

PATCH 3/4 board: amlogic: select PWRSEQ for all amlogic platform

In reply to Anand Moon

commit a10388dc6982 ("mmc: meson-gx: add support for mmc-pwrseq-emmc") introduce CONFIG_PWESEQ for power sequence for eMMC module on amlogic platform, so enable this to all amlogic boards.

---
 arch/arm/mach-meson/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-meson/Kconfig +1 -0
index e29e4c0acc..513a33dae2 100644
@@ -8,6 +8,7 @@ config MESON64_COMMON
 	select DM_SERIAL
 	select SYSCON
 	select REGMAP
+	select PWRSEQ
 	select BOARD_LATE_INIT
 	imply CMD_DM
 
Signature · 1 line
2.24.0
#13 lore raw

PATCH 3/4 board: amlogic: select PWRSEQ for all amlogic platform

Quoted 15 lines · Anand Moon

commit a10388dc6982 ("mmc: meson-gx: add support for mmc-pwrseq-emmc") introduce CONFIG_PWESEQ for power sequence for eMMC module on amlogic platform, so enable this to all amlogic boards.

---
 arch/arm/mach-meson/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-meson/Kconfig +0 -0
index e29e4c0acc..513a33dae2 100644

arch/arm/mach-meson/Kconfig config MESON64_COMMON · line 14

Quoted 7 lines
arch/arm/mach-meson/Kconfig +1 -0
@@ -8,6 +8,7 @@ config MESON64_COMMON
 	select DM_SERIAL
 	select SYSCON
 	select REGMAP
+	select PWRSEQ
 	select BOARD_LATE_INIT
 	imply CMD_DM
 
author
#14 lore raw

PATCH 4/4 board: amlogic: Add missing config option

In reply to Anand Moon

Add missing config option CONFIG_MESON_GXBB and CONFIG_SYS_BOARD, for odroid-c2 and nanopi k2 board

---
 configs/nanopi-k2_defconfig | 2 ++
 configs/odroid-c2_defconfig | 2 ++
 2 files changed, 4 insertions(+)
configs/nanopi-k2_defconfig +2 -0
index 7bdeb7906a..3d6265c587 100644
@@ -1,6 +1,8 @@
 CONFIG_ARM=y
+CONFIG_SYS_BOARD="p200"
 CONFIG_ARCH_MESON=y
 CONFIG_SYS_TEXT_BASE=0x01000000
+CONFIG_MESON_GXBB=y
 CONFIG_ENV_SIZE=0x2000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xc81004c0
configs/odroid-c2_defconfig +2 -0
index 1f5a52c57c..700c871918 100644
@@ -1,6 +1,8 @@
 CONFIG_ARM=y
+CONFIG_SYS_BOARD="p200"
 CONFIG_ARCH_MESON=y
 CONFIG_SYS_TEXT_BASE=0x01000000
+CONFIG_MESON_GXBB=y
 CONFIG_ENV_SIZE=0x2000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xc81004c0
Signature · 1 line
2.24.0
#15 lore raw

PATCH 4/4 board: amlogic: Add missing config option

Hi,

Quoted 28 lines · Anand Moon

Add missing config option CONFIG_MESON_GXBB and CONFIG_SYS_BOARD, for odroid-c2 and nanopi k2 board

---
 configs/nanopi-k2_defconfig | 2 ++
 configs/odroid-c2_defconfig | 2 ++
 2 files changed, 4 insertions(+)
configs/nanopi-k2_defconfig +2 -0
index 7bdeb7906a..3d6265c587 100644
@@ -1,6 +1,8 @@
 CONFIG_ARM=y
+CONFIG_SYS_BOARD="p200"
 CONFIG_ARCH_MESON=y
 CONFIG_SYS_TEXT_BASE=0x01000000
+CONFIG_MESON_GXBB=y
 CONFIG_ENV_SIZE=0x2000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xc81004c0
configs/odroid-c2_defconfig +0 -0
index 1f5a52c57c..700c871918 100644

configs/odroid-c2_defconfig line 8

Quoted 8 lines
configs/odroid-c2_defconfig +2 -0
@@ -1,6 +1,8 @@
 CONFIG_ARM=y
+CONFIG_SYS_BOARD="p200"
 CONFIG_ARCH_MESON=y
 CONFIG_SYS_TEXT_BASE=0x01000000
+CONFIG_MESON_GXBB=y
 CONFIG_ENV_SIZE=0x2000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xc81004c0

These are not present since they are the default values, thus not exported in savedefconfig.

Neil

author
#16 lore raw

PATCH 4/4 board: amlogic: Add missing config option

Hi Neil,

Quoted 43 lines · Neil Armstrong

Hi,

Quoted 28 lines · Anand Moon

Add missing config option CONFIG_MESON_GXBB and CONFIG_SYS_BOARD, for odroid-c2 and nanopi k2 board

---
 configs/nanopi-k2_defconfig | 2 ++
 configs/odroid-c2_defconfig | 2 ++
 2 files changed, 4 insertions(+)
configs/nanopi-k2_defconfig +2 -0
index 7bdeb7906a..3d6265c587 100644
@@ -1,6 +1,8 @@
 CONFIG_ARM=y
+CONFIG_SYS_BOARD="p200"
 CONFIG_ARCH_MESON=y
 CONFIG_SYS_TEXT_BASE=0x01000000
+CONFIG_MESON_GXBB=y
 CONFIG_ENV_SIZE=0x2000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xc81004c0
configs/odroid-c2_defconfig +0 -0
index 1f5a52c57c..700c871918 100644

configs/odroid-c2_defconfig line 8

Quoted 8 lines
configs/odroid-c2_defconfig +2 -0
@@ -1,6 +1,8 @@
 CONFIG_ARM=y
+CONFIG_SYS_BOARD="p200"
 CONFIG_ARCH_MESON=y
 CONFIG_SYS_TEXT_BASE=0x01000000
+CONFIG_MESON_GXBB=y
 CONFIG_ENV_SIZE=0x2000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xc81004c0

These are not present since they are the default values, thus not exported in savedefconfig.

Quoted 1 line

Neil

You can ignore and drop this changes.

-Anand