Skip to contentSkip to conversation

Broken u-boot on n900 hw (possibly CONFIG_POSITION_INDEPENDENT)

DISCUSSION Pali Rohár 4 participants 11 messages Oct 9, 2022 – Nov 20, 2022

lore
Share & tools
lore
#0 lore raw

Hello!

Current u-boot from master branch does not work on n900 hw. It does not show anything on display, there just nokia logo.

In qemu it is working fine and all tests are passing. Also in qemu is display working without any problem.

Could you help me to debug it? Maybe something is printed to serial console? Or maybe serial console could be used for printf-debugging?

I just figured out that disabling CONFIG_POSITION_INDEPENDENT u-boot option make it working again. But it requires to restoring older version of lowlevel_init.S file which does not depend on POSITION_INDEPENDENT:

    git checkout 7c4ad9821758f98db127e9d6864671c906c02d3b -- board/nokia/rx51/lowlevel_init.S

And also setting CONFIG_SYS_TEXT_BASE=0x80008000 (to some value in RAM).

I'm looking at the POSITION_INDEPENDENT usage and seems that only few boards have it enabled and even less of them are 32-bit ARM.

So it is possible that there is bug in POSITION_INDEPENDENT code? I just do not understand how it is possible that u-boot binary is working fine in qemu, but not on the real HW...

#1 lore raw
Quoted 11 lines · Pali Rohár

Hello!

Current u-boot from master branch does not work on n900 hw. It does not show anything on display, there just nokia logo.

In qemu it is working fine and all tests are passing. Also in qemu is display working without any problem.

Could you help me to debug it? Maybe something is printed to serial console? Or maybe serial console could be used for printf-debugging?

Quoted 7 lines

I just figured out that disabling CONFIG_POSITION_INDEPENDENT u-boot option make it working again. But it requires to restoring older version of lowlevel_init.S file which does not depend on POSITION_INDEPENDENT:

    git checkout 7c4ad9821758f98db127e9d6864671c906c02d3b -- board/nokia/rx51/lowlevel_init.S

And also setting CONFIG_SYS_TEXT_BASE=0x80008000 (to some value in RAM).

Hi

I have a really crude serial console setup in place now, but very little time, and even less experience with u-boot. I should be able to do the tests for you on Saturday night (UTC+2). Perhaps over IRC might be a good idea, in case I need some hand-holding, and if you still need the help by then.

Regards
Sicelo

#2 lore raw
Quoted 22 lines · On Monday 10 October 2022 23:30:21 Sicelo wrote:
Quoted 11 lines · Pali Rohár

Hello!

Current u-boot from master branch does not work on n900 hw. It does not show anything on display, there just nokia logo.

In qemu it is working fine and all tests are passing. Also in qemu is display working without any problem.

Could you help me to debug it? Maybe something is printed to serial console? Or maybe serial console could be used for printf-debugging?

Quoted 7 lines

I just figured out that disabling CONFIG_POSITION_INDEPENDENT u-boot option make it working again. But it requires to restoring older version of lowlevel_init.S file which does not depend on POSITION_INDEPENDENT:

    git checkout 7c4ad9821758f98db127e9d6864671c906c02d3b -- board/nokia/rx51/lowlevel_init.S

And also setting CONFIG_SYS_TEXT_BASE=0x80008000 (to some value in RAM).

Hi

Quoted 8 lines

I have a really crude serial console setup in place now, but very little time, and even less experience with u-boot. I should be able to do the tests for you on Saturday night (UTC+2). Perhaps over IRC might be a good idea, in case I need some hand-holding, and if you still need the help by then.

Regards
Sicelo

Well, I do not know where to start or how to instruct somebody who is not experienced with u-boot debugging. I think that the first step should be to look if U-Boot prints something on the serial console or not. If it prints then try to find via printf-driven-debugging place where it stuck. If it does not print anything on the console then try to setup debug early console, check if it prints something now and do same type of debugging. And if even early debug console does not work then probably initialize serial console directly in lowlevel_init.S file, prints something to serial, then move code for printing to later stage and try to figure out what is broken...

Anybody else with serial console can look at it?

Or maybe look at the code if you spot some issue there?

#3 lore raw
Quoted 32 lines · On Thursday 20 October 2022 22:06:58 Pali Rohár wrote:
Quoted 22 lines · On Monday 10 October 2022 23:30:21 Sicelo wrote:
Quoted 11 lines · Pali Rohár

Hello!

Current u-boot from master branch does not work on n900 hw. It does not show anything on display, there just nokia logo.

In qemu it is working fine and all tests are passing. Also in qemu is display working without any problem.

Could you help me to debug it? Maybe something is printed to serial console? Or maybe serial console could be used for printf-debugging?

Quoted 7 lines

I just figured out that disabling CONFIG_POSITION_INDEPENDENT u-boot option make it working again. But it requires to restoring older version of lowlevel_init.S file which does not depend on POSITION_INDEPENDENT:

    git checkout 7c4ad9821758f98db127e9d6864671c906c02d3b -- board/nokia/rx51/lowlevel_init.S

And also setting CONFIG_SYS_TEXT_BASE=0x80008000 (to some value in RAM).

Hi

Quoted 8 lines

I have a really crude serial console setup in place now, but very little time, and even less experience with u-boot. I should be able to do the tests for you on Saturday night (UTC+2). Perhaps over IRC might be a good idea, in case I need some hand-holding, and if you still need the help by then.

Regards
Sicelo

Quoted 10 lines

Well, I do not know where to start or how to instruct somebody who is not experienced with u-boot debugging. I think that the first step should be to look if U-Boot prints something on the serial console or not. If it prints then try to find via printf-driven-debugging place where it stuck. If it does not print anything on the console then try to setup debug early console, check if it prints something now and do same type of debugging. And if even early debug console does not work then probably initialize serial console directly in lowlevel_init.S file, prints something to serial, then move code for printing to later stage and try to figure out what is broken...

Early debug uart console can be enabled by configs/nokia_rx51_defconfig options:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_OMAP=y
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_DEBUG_UART_BASE=0x49020000
CONFIG_DEBUG_UART_CLOCK=48000000

And all debug verbose logs can be enabled by configs/nokia_rx51_defconfig options:

CONFIG_DM_DEBUG=y
CONFIG_LOG=y
CONFIG_LOGLEVEL=9
CONFIG_LOG_MAX_LEVEL=9
CONFIG_LOG_DEFAULT_LEVEL=9

By compiling via 'make u-boot.bin KCPPFLAGS=-DLOG_DEBUG'

At least in qemu it is working and printing everything.

Quoted 3 lines

Anybody else with serial console can look at it?

Or maybe look at the code if you spot some issue there?

#4 lore raw
Quoted 54 lines · On Friday 21 October 2022 21:09:55 Pali Rohár wrote:
Quoted 32 lines · On Thursday 20 October 2022 22:06:58 Pali Rohár wrote:
Quoted 22 lines · On Monday 10 October 2022 23:30:21 Sicelo wrote:
Quoted 11 lines · Pali Rohár

Hello!

Current u-boot from master branch does not work on n900 hw. It does not show anything on display, there just nokia logo.

In qemu it is working fine and all tests are passing. Also in qemu is display working without any problem.

Could you help me to debug it? Maybe something is printed to serial console? Or maybe serial console could be used for printf-debugging?

Quoted 7 lines

I just figured out that disabling CONFIG_POSITION_INDEPENDENT u-boot option make it working again. But it requires to restoring older version of lowlevel_init.S file which does not depend on POSITION_INDEPENDENT:

    git checkout 7c4ad9821758f98db127e9d6864671c906c02d3b -- board/nokia/rx51/lowlevel_init.S

And also setting CONFIG_SYS_TEXT_BASE=0x80008000 (to some value in RAM).

Hi

Quoted 8 lines

I have a really crude serial console setup in place now, but very little time, and even less experience with u-boot. I should be able to do the tests for you on Saturday night (UTC+2). Perhaps over IRC might be a good idea, in case I need some hand-holding, and if you still need the help by then.

Regards
Sicelo

Quoted 10 lines

Well, I do not know where to start or how to instruct somebody who is not experienced with u-boot debugging. I think that the first step should be to look if U-Boot prints something on the serial console or not. If it prints then try to find via printf-driven-debugging place where it stuck. If it does not print anything on the console then try to setup debug early console, check if it prints something now and do same type of debugging. And if even early debug console does not work then probably initialize serial console directly in lowlevel_init.S file, prints something to serial, then move code for printing to later stage and try to figure out what is broken...

Early debug uart console can be enabled by configs/nokia_rx51_defconfig options:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_OMAP=y
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_DEBUG_UART_BASE=0x49020000
CONFIG_DEBUG_UART_CLOCK=48000000

And all debug verbose logs can be enabled by configs/nokia_rx51_defconfig options:

Quoted 7 lines

CONFIG_DM_DEBUG=y
CONFIG_LOG=y
CONFIG_LOGLEVEL=9
CONFIG_LOG_MAX_LEVEL=9
CONFIG_LOG_DEFAULT_LEVEL=9

By compiling via 'make u-boot.bin KCPPFLAGS=-DLOG_DEBUG'

Can somebody with serial console provide this debug output if there is something useful?

Quoted 5 lines

At least in qemu it is working and printing everything.

Quoted 3 lines

Anybody else with serial console can look at it?

Or maybe look at the code if you spot some issue there?

#5 lore raw
Quoted 61 lines · On Wednesday 02 November 2022 01:08:26 Pali Rohár wrote:
Quoted 60 lines · On Friday 21 October 2022 21:09:55 Pali Rohár wrote:
Quoted 32 lines · On Thursday 20 October 2022 22:06:58 Pali Rohár wrote:
Quoted 22 lines · On Monday 10 October 2022 23:30:21 Sicelo wrote:
Quoted 11 lines · Pali Rohár

Hello!

Current u-boot from master branch does not work on n900 hw. It does not show anything on display, there just nokia logo.

In qemu it is working fine and all tests are passing. Also in qemu is display working without any problem.

Could you help me to debug it? Maybe something is printed to serial console? Or maybe serial console could be used for printf-debugging?

Quoted 7 lines

I just figured out that disabling CONFIG_POSITION_INDEPENDENT u-boot option make it working again. But it requires to restoring older version of lowlevel_init.S file which does not depend on POSITION_INDEPENDENT:

    git checkout 7c4ad9821758f98db127e9d6864671c906c02d3b -- board/nokia/rx51/lowlevel_init.S

And also setting CONFIG_SYS_TEXT_BASE=0x80008000 (to some value in RAM).

Hi

Quoted 8 lines

I have a really crude serial console setup in place now, but very little time, and even less experience with u-boot. I should be able to do the tests for you on Saturday night (UTC+2). Perhaps over IRC might be a good idea, in case I need some hand-holding, and if you still need the help by then.

Regards
Sicelo

Quoted 10 lines

Well, I do not know where to start or how to instruct somebody who is not experienced with u-boot debugging. I think that the first step should be to look if U-Boot prints something on the serial console or not. If it prints then try to find via printf-driven-debugging place where it stuck. If it does not print anything on the console then try to setup debug early console, check if it prints something now and do same type of debugging. And if even early debug console does not work then probably initialize serial console directly in lowlevel_init.S file, prints something to serial, then move code for printing to later stage and try to figure out what is broken...

Early debug uart console can be enabled by configs/nokia_rx51_defconfig options:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_OMAP=y
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_DEBUG_UART_BASE=0x49020000
CONFIG_DEBUG_UART_CLOCK=48000000

And all debug verbose logs can be enabled by configs/nokia_rx51_defconfig options:

CONFIG_DM_DEBUG=y
CONFIG_LOG=y
CONFIG_LOGLEVEL=9
CONFIG_LOG_MAX_LEVEL=9
CONFIG_LOG_DEFAULT_LEVEL=9

Quoted 4 lines
Quoted 1 line

By compiling via 'make u-boot.bin KCPPFLAGS=-DLOG_DEBUG'

Can somebody with serial console provide this debug output if there is something useful?

Can somebody help me with this?

Quoted 5 lines
Quoted 5 lines

At least in qemu it is working and printing everything.

Quoted 3 lines

Anybody else with serial console can look at it?

Or maybe look at the code if you spot some issue there?

#6 lore raw

Hi,

I am new. I am trying to figure out the right pogo pins to get in order to try to build a serial port for N900. But I am trying to decipher the docs in the wiki at the moment.

Best,

Signature · 1 line
  Ashish Shah
Quoted 78 lines · Pali Rohár
Quoted 61 lines · On Wednesday 02 November 2022 01:08:26 Pali Rohár wrote:
Quoted 60 lines · On Friday 21 October 2022 21:09:55 Pali Rohár wrote:
Quoted 32 lines · On Thursday 20 October 2022 22:06:58 Pali Rohár wrote:
Quoted 22 lines · On Monday 10 October 2022 23:30:21 Sicelo wrote:
Quoted 11 lines · Pali Rohár

Hello!

Current u-boot from master branch does not work on n900 hw. It does not show anything on display, there just nokia logo.

In qemu it is working fine and all tests are passing. Also in qemu is display working without any problem.

Could you help me to debug it? Maybe something is printed to serial console? Or maybe serial console could be used for printf-debugging?

Quoted 7 lines

I just figured out that disabling CONFIG_POSITION_INDEPENDENT u-boot option make it working again. But it requires to restoring older version of lowlevel_init.S file which does not depend on POSITION_INDEPENDENT:

    git checkout 7c4ad9821758f98db127e9d6864671c906c02d3b -- board/nokia/rx51/lowlevel_init.S

And also setting CONFIG_SYS_TEXT_BASE=0x80008000 (to some value in RAM).

Hi

Quoted 8 lines

I have a really crude serial console setup in place now, but very little time, and even less experience with u-boot. I should be able to do the tests for you on Saturday night (UTC+2). Perhaps over IRC might be a good idea, in case I need some hand-holding, and if you still need the help by then.

Regards
Sicelo

Quoted 10 lines

Well, I do not know where to start or how to instruct somebody who is not experienced with u-boot debugging. I think that the first step should be to look if U-Boot prints something on the serial console or not. If it prints then try to find via printf-driven-debugging place where it stuck. If it does not print anything on the console then try to setup debug early console, check if it prints something now and do same type of debugging. And if even early debug console does not work then probably initialize serial console directly in lowlevel_init.S file, prints something to serial, then move code for printing to later stage and try to figure out what is broken...

Early debug uart console can be enabled by configs/nokia_rx51_defconfig options:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_OMAP=y
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_DEBUG_UART_BASE=0x49020000
CONFIG_DEBUG_UART_CLOCK=48000000

And all debug verbose logs can be enabled by configs/nokia_rx51_defconfig options:

CONFIG_DM_DEBUG=y
CONFIG_LOG=y
CONFIG_LOGLEVEL=9
CONFIG_LOG_MAX_LEVEL=9
CONFIG_LOG_DEFAULT_LEVEL=9

Quoted 4 lines
Quoted 1 line

By compiling via 'make u-boot.bin KCPPFLAGS=-DLOG_DEBUG'

Can somebody with serial console provide this debug output if there is something useful?

Can somebody help me with this?

Quoted 5 lines
Quoted 5 lines

At least in qemu it is working and printing everything.

Quoted 3 lines

Anybody else with serial console can look at it?

Or maybe look at the code if you spot some issue there?

_______________________________________________
Maemo-Leste mailing list
[email protected]
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/maemo-leste

#7 lore raw
Quoted 8 lines · Ashish Shah

Hi,

I am new. I am trying to figure out the right pogo pins to get in order to try to build a serial port for N900. But I am trying to decipher the docs in the wiki at the moment.

Best,

Signature · 1 line
  Ashish Shah

Welcome!

I didn't succeed yet with making one, but that is not because it is extremely difficult - I just happen to live where access to such stuff isn't straightforward.

That said, if you have access to the materials, you can start with sre's blog [0]. Additionally, chapter 3 of his thesis [1] has quite verbose description of everything that is needed, as well as a diagram (Figure 3.3) clearly showing the location of the required pins.

We can also help you with any further information you may need.

Regards
Sicelo

[0] https://n900.elektranox.org/serial-adapter.html
[1] https://uol.de/f/2/dept/informatik/ag/svs/download/thesis/Reichel_Sebastian.pdf

#8 lore raw
In reply to Pali Rohár
Quoted 62 lines · On Wednesday 09 November 2022 21:33:28 Pali Rohár wrote:
Quoted 61 lines · On Wednesday 02 November 2022 01:08:26 Pali Rohár wrote:
Quoted 60 lines · On Friday 21 October 2022 21:09:55 Pali Rohár wrote:
Quoted 32 lines · On Thursday 20 October 2022 22:06:58 Pali Rohár wrote:
Quoted 22 lines · On Monday 10 October 2022 23:30:21 Sicelo wrote:
Quoted 11 lines · Pali Rohár

Hello!

Current u-boot from master branch does not work on n900 hw. It does not show anything on display, there just nokia logo.

In qemu it is working fine and all tests are passing. Also in qemu is display working without any problem.

Could you help me to debug it? Maybe something is printed to serial console? Or maybe serial console could be used for printf-debugging?

Quoted 7 lines

I just figured out that disabling CONFIG_POSITION_INDEPENDENT u-boot option make it working again. But it requires to restoring older version of lowlevel_init.S file which does not depend on POSITION_INDEPENDENT:

    git checkout 7c4ad9821758f98db127e9d6864671c906c02d3b -- board/nokia/rx51/lowlevel_init.S

And also setting CONFIG_SYS_TEXT_BASE=0x80008000 (to some value in RAM).

Hi

Quoted 8 lines

I have a really crude serial console setup in place now, but very little time, and even less experience with u-boot. I should be able to do the tests for you on Saturday night (UTC+2). Perhaps over IRC might be a good idea, in case I need some hand-holding, and if you still need the help by then.

Regards
Sicelo

Quoted 10 lines

Well, I do not know where to start or how to instruct somebody who is not experienced with u-boot debugging. I think that the first step should be to look if U-Boot prints something on the serial console or not. If it prints then try to find via printf-driven-debugging place where it stuck. If it does not print anything on the console then try to setup debug early console, check if it prints something now and do same type of debugging. And if even early debug console does not work then probably initialize serial console directly in lowlevel_init.S file, prints something to serial, then move code for printing to later stage and try to figure out what is broken...

Early debug uart console can be enabled by configs/nokia_rx51_defconfig options:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_OMAP=y
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_DEBUG_UART_BASE=0x49020000
CONFIG_DEBUG_UART_CLOCK=48000000

And all debug verbose logs can be enabled by configs/nokia_rx51_defconfig options:

CONFIG_DM_DEBUG=y
CONFIG_LOG=y
CONFIG_LOGLEVEL=9
CONFIG_LOG_MAX_LEVEL=9
CONFIG_LOG_DEFAULT_LEVEL=9

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

By compiling via 'make u-boot.bin KCPPFLAGS=-DLOG_DEBUG'

Can somebody with serial console provide this debug output if there is something useful?

Can somebody help me with this?

Merlijn Wajer now sent me output from serial console:

...
initcall: 0001ebd4 (relocated to 8fe0abd4)
MMC: 0
- 0 'omap_hsmmc'
- found
1
- 0 'omap_hsmmc'
- 1 'omap_hsmmc'
- found
2
- 0 'omap_hsmmc'
- 1 'omap_hsmmc'
- not found
OMAP SD/MMC: 0, OMAP SD/MMC: 1
initcall: 0001ea8c (relocated to 8fe0aa8c)
Loading Environment from <NULL>... Using default environment Destroy Hash Table: 8fe25a98 table = 00000000 Create Hash Table: N=387

After the "Create Hash Table: N=387" line there is nothing more. Repeated tests have same result, always stop at that line.

In qemu after that line I see following output:

INSERT: table 8fe25a98, filled 1/389 rv 8fd0e2f4 ==> name="bootcmd" value="run sdboot;run emmcboot;run attachboot;echo"
INSERT: table 8fe25a98, filled 2/389 rv 8fd0e344 ==> name="bootdelay" value="30"
INSERT: table 8fe25a98, filled 3/389 rv 8fd0f960 ==> name="baudrate" value="115200"
DELETE CANDIDATE: "preboot"
hdelete: DELETE key "preboot"
DELETE ERROR ##############################
INSERT: table 8fe25a98, filled 4/389 rv 8fd0e574 ==> name="loadaddr" value="0x80008000"
...

In qemu is u-boot working fine.

So it looks like that there is u-boot crash in environment code and only when running on real HW.

Any idea? Could there be some relocation issue in u-boot env code?

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

At least in qemu it is working and printing everything.

Quoted 3 lines

Anybody else with serial console can look at it?

Or maybe look at the code if you spot some issue there?

#9 lore raw
Quoted 105 lines · Pali Rohár
Quoted 62 lines · On Wednesday 09 November 2022 21:33:28 Pali Rohár wrote:
Quoted 61 lines · On Wednesday 02 November 2022 01:08:26 Pali Rohár wrote:
Quoted 60 lines · On Friday 21 October 2022 21:09:55 Pali Rohár wrote:
Quoted 32 lines · On Thursday 20 October 2022 22:06:58 Pali Rohár wrote:
Quoted 22 lines · On Monday 10 October 2022 23:30:21 Sicelo wrote:
Quoted 11 lines · Pali Rohár

Hello!

Current u-boot from master branch does not work on n900 hw. It does not show anything on display, there just nokia logo.

In qemu it is working fine and all tests are passing. Also in qemu is display working without any problem.

Could you help me to debug it? Maybe something is printed to serial console? Or maybe serial console could be used for printf-debugging?

Quoted 7 lines

I just figured out that disabling CONFIG_POSITION_INDEPENDENT u-boot option make it working again. But it requires to restoring older version of lowlevel_init.S file which does not depend on POSITION_INDEPENDENT:

    git checkout 7c4ad9821758f98db127e9d6864671c906c02d3b -- board/nokia/rx51/lowlevel_init.S

And also setting CONFIG_SYS_TEXT_BASE=0x80008000 (to some value in RAM).

Hi

Quoted 8 lines

I have a really crude serial console setup in place now, but very little time, and even less experience with u-boot. I should be able to do the tests for you on Saturday night (UTC+2). Perhaps over IRC might be a good idea, in case I need some hand-holding, and if you still need the help by then.

Regards
Sicelo

Quoted 10 lines

Well, I do not know where to start or how to instruct somebody who is not experienced with u-boot debugging. I think that the first step should be to look if U-Boot prints something on the serial console or not. If it prints then try to find via printf-driven-debugging place where it stuck. If it does not print anything on the console then try to setup debug early console, check if it prints something now and do same type of debugging. And if even early debug console does not work then probably initialize serial console directly in lowlevel_init.S file, prints something to serial, then move code for printing to later stage and try to figure out what is broken...

Early debug uart console can be enabled by configs/nokia_rx51_defconfig options:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_OMAP=y
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_DEBUG_UART_BASE=0x49020000
CONFIG_DEBUG_UART_CLOCK=48000000

And all debug verbose logs can be enabled by configs/nokia_rx51_defconfig options:

CONFIG_DM_DEBUG=y
CONFIG_LOG=y
CONFIG_LOGLEVEL=9
CONFIG_LOG_MAX_LEVEL=9
CONFIG_LOG_DEFAULT_LEVEL=9

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

By compiling via 'make u-boot.bin KCPPFLAGS=-DLOG_DEBUG'

Can somebody with serial console provide this debug output if there is something useful?

Can somebody help me with this?

Merlijn Wajer now sent me output from serial console:

...
initcall: 0001ebd4 (relocated to 8fe0abd4)
MMC: 0
- 0 'omap_hsmmc'
- found
1
- 0 'omap_hsmmc'
- 1 'omap_hsmmc'
- found
2
- 0 'omap_hsmmc'
- 1 'omap_hsmmc'
- not found
OMAP SD/MMC: 0, OMAP SD/MMC: 1
initcall: 0001ea8c (relocated to 8fe0aa8c)
Loading Environment from <NULL>... Using default environment Destroy Hash Table: 8fe25a98 table = 00000000 Create Hash Table: N=387

After the "Create Hash Table: N=387" line there is nothing more. Repeated tests have same result, always stop at that line.

In qemu after that line I see following output:

INSERT: table 8fe25a98, filled 1/389 rv 8fd0e2f4 ==> name="bootcmd" value="run sdboot;run emmcboot;run attachboot;echo"
INSERT: table 8fe25a98, filled 2/389 rv 8fd0e344 ==> name="bootdelay" value="30"
INSERT: table 8fe25a98, filled 3/389 rv 8fd0f960 ==> name="baudrate" value="115200"
DELETE CANDIDATE: "preboot"
hdelete: DELETE key "preboot"
DELETE ERROR ##############################
INSERT: table 8fe25a98, filled 4/389 rv 8fd0e574 ==> name="loadaddr" value="0x80008000"
...

Quoted 6 lines

In qemu is u-boot working fine.

So it looks like that there is u-boot crash in environment code and only when running on real HW.

Any idea? Could there be some relocation issue in u-boot env code?

My first thought here is that something like 534f0fbd6520 ("arm64: Fix relocation of env_addr if POSITION_INDEPENDENT=y") might be needed on 32bit as well?

Signature · 1 line
Tom
#10 lore raw
Quoted 108 lines · On Sunday 20 November 2022 10:33:35 Tom Rini wrote:
Quoted 107 lines · Pali Rohár
Quoted 62 lines · On Wednesday 09 November 2022 21:33:28 Pali Rohár wrote:
Quoted 61 lines · On Wednesday 02 November 2022 01:08:26 Pali Rohár wrote:
Quoted 60 lines · On Friday 21 October 2022 21:09:55 Pali Rohár wrote:
Quoted 32 lines · On Thursday 20 October 2022 22:06:58 Pali Rohár wrote:
Quoted 22 lines · On Monday 10 October 2022 23:30:21 Sicelo wrote:
Quoted 11 lines · Pali Rohár

Hello!

Current u-boot from master branch does not work on n900 hw. It does not show anything on display, there just nokia logo.

In qemu it is working fine and all tests are passing. Also in qemu is display working without any problem.

Could you help me to debug it? Maybe something is printed to serial console? Or maybe serial console could be used for printf-debugging?

Quoted 7 lines

I just figured out that disabling CONFIG_POSITION_INDEPENDENT u-boot option make it working again. But it requires to restoring older version of lowlevel_init.S file which does not depend on POSITION_INDEPENDENT:

    git checkout 7c4ad9821758f98db127e9d6864671c906c02d3b -- board/nokia/rx51/lowlevel_init.S

And also setting CONFIG_SYS_TEXT_BASE=0x80008000 (to some value in RAM).

Hi

Quoted 8 lines

I have a really crude serial console setup in place now, but very little time, and even less experience with u-boot. I should be able to do the tests for you on Saturday night (UTC+2). Perhaps over IRC might be a good idea, in case I need some hand-holding, and if you still need the help by then.

Regards
Sicelo

Quoted 10 lines

Well, I do not know where to start or how to instruct somebody who is not experienced with u-boot debugging. I think that the first step should be to look if U-Boot prints something on the serial console or not. If it prints then try to find via printf-driven-debugging place where it stuck. If it does not print anything on the console then try to setup debug early console, check if it prints something now and do same type of debugging. And if even early debug console does not work then probably initialize serial console directly in lowlevel_init.S file, prints something to serial, then move code for printing to later stage and try to figure out what is broken...

Early debug uart console can be enabled by configs/nokia_rx51_defconfig options:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_OMAP=y
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_DEBUG_UART_BASE=0x49020000
CONFIG_DEBUG_UART_CLOCK=48000000

And all debug verbose logs can be enabled by configs/nokia_rx51_defconfig options:

CONFIG_DM_DEBUG=y
CONFIG_LOG=y
CONFIG_LOGLEVEL=9
CONFIG_LOG_MAX_LEVEL=9
CONFIG_LOG_DEFAULT_LEVEL=9

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

By compiling via 'make u-boot.bin KCPPFLAGS=-DLOG_DEBUG'

Can somebody with serial console provide this debug output if there is something useful?

Can somebody help me with this?

Merlijn Wajer now sent me output from serial console:

...
initcall: 0001ebd4 (relocated to 8fe0abd4)
MMC: 0
- 0 'omap_hsmmc'
- found
1
- 0 'omap_hsmmc'
- 1 'omap_hsmmc'
- found
2
- 0 'omap_hsmmc'
- 1 'omap_hsmmc'
- not found
OMAP SD/MMC: 0, OMAP SD/MMC: 1
initcall: 0001ea8c (relocated to 8fe0aa8c)
Loading Environment from <NULL>... Using default environment Destroy Hash Table: 8fe25a98 table = 00000000 Create Hash Table: N=387

After the "Create Hash Table: N=387" line there is nothing more. Repeated tests have same result, always stop at that line.

In qemu after that line I see following output:

INSERT: table 8fe25a98, filled 1/389 rv 8fd0e2f4 ==> name="bootcmd" value="run sdboot;run emmcboot;run attachboot;echo"
INSERT: table 8fe25a98, filled 2/389 rv 8fd0e344 ==> name="bootdelay" value="30"
INSERT: table 8fe25a98, filled 3/389 rv 8fd0f960 ==> name="baudrate" value="115200"
DELETE CANDIDATE: "preboot"
hdelete: DELETE key "preboot"
DELETE ERROR ##############################
INSERT: table 8fe25a98, filled 4/389 rv 8fd0e574 ==> name="loadaddr" value="0x80008000"
...

In qemu is u-boot working fine.

Quoted 11 lines
Quoted 4 lines

So it looks like that there is u-boot crash in environment code and only when running on real HW.

Any idea? Could there be some relocation issue in u-boot env code?

My first thought here is that something like 534f0fbd6520 ("arm64: Fix relocation of env_addr if POSITION_INDEPENDENT=y") might be needed on 32bit as well?

Signature · 1 line
Tom

Thank you Tom! This is really the issue. After I applied same fix for 32-bit ARM, U-Boot on real N900 HW booted. I will send a patch for it.

Interesting is that same u-boot binary is working fine in qemu N900. And it works with and also without fix for env_addr.