maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Alternatives (https://talk.maemo.org/forumdisplay.php?f=36)
-   -   u-boot for the RX-51 (N900) (https://talk.maemo.org/showthread.php?t=62146)

Fabry 2011-10-09 13:56

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by pali (Post 1105970)
No, It is same because first is multiply and then is byteshift. Try this:

Code:

printf("%#x %#x\n", 4*114 >> 2, 114);
printf("%#x %#x\n", 4*46 >> 2, 46);

output is:

Code:

0x72 0x72
0x2e 0x2e


Sorry but you are wrong.

My example was for a BYTE datatype, if you use an INT it is normal that it works as you expected because my numbers are too little to generate an overflow during left shift.

But please try with correct numbers
Code:

printf("%#x %#x\n", 4*1073741824>> 2, 1073741824);
printf("%#x %#x\n", 4*3075541994>> 2, 3075541994);

And the above code yields to these results:
Code:

0x0 0x40000000
0x37510bea 0xb7510bea

Numbers are very different now.

I reapet that C code like n<<VAR>>n (or (2^n)*VAR>>n) is usually used to clear the n most significative bits of VAR (if VAR is unsigned)

Fabry 2011-10-09 14:13

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by mirakels (Post 1105965)
Yes it will be the same and probably will be compiled away.
But in this form it will show the weirdness of needing to scroll way beyond
the actual framebuffer.

It is the same only for values smaller than 2^(n-2), where n is the number of bits contained on you variable/constant (8, 16, 32 or 64).
So compiler can optimize (and remove useless operations) only if it is a constant and the fixed value assigned is less then 2^(n-2) alias 1,073,741,824 for an integer costant

pali 2011-10-12 18:58

Re: u-boot for the RX-51 (N900)
 
@Fabry: ok, now I know this, but in U-Boot our number was not very big (so no change)

pali 2011-10-12 19:01

Re: u-boot for the RX-51 (N900)
 
Now I published new version of U-Boot. It has fixed eMMC support and runtime configurable bootmenu.

Source code is now in branch pali on u-boot-shr: https://gitorious.org/u-boot-shr/u-boot/commits/pali

Fabry 2011-10-12 19:45

Re: u-boot for the RX-51 (N900)
 
Good job.

Now when this problems:
  • High power consumption
  • Incompatibility with HW Rev different from 2101 (as Matan's version)
will be fixed, Pali's u-boot will be the best boot-loader for N900

pali 2011-10-12 20:38

Re: u-boot for the RX-51 (N900)
 
For compatibility with other HW revisions, see http://talk.maemo.org/showpost.php?p...&postcount=120
Should work on 2101, 2204 and 2104...

And power problem. Now we have in u-boot code for twl4030 regulator, so we have tool for power control. Also code for control GPIO and MUX is in u-boot too...

Fabry 2011-10-13 00:47

Re: u-boot for the RX-51 (N900)
 
So the two problems have been already fixed ?

I have a rev 2101 and I can check eventually only power consumption.

Hurrian 2011-10-13 01:12

Re: u-boot for the RX-51 (N900)
 
Holy ****, Pali! This is better than Multiboot! ;)
I'm going to measure power consumption before/after u-boot when I have time (probably this Saturday).

Can we have this by default in power50?

Fabry 2011-10-13 05:26

Re: u-boot for the RX-51 (N900)
 
I made an attempt with the new kp48 image.

These are the problems found:
  • Power consumption problem is still present.
    Initially it seems that p. consumption is normal (discharge rate on idle = 1-3% / hour) but after 1-2 hours of continuos idle the situation changes and becomes "discharge rate on idle greater than 10% / hour"
  • Lcd screen is always powered on.
    Maemo never turns off it, it only shows a black screen (with backlight on, this is evident on a dark room)
  • There is problem with battery's charge measurement.
    I had 50% of reported battery's charge and I have rebooted the phone.
    After reboot reported battery's charge was only 7% and some mins after it was still 7%.
    I doubted that a boot process can really consume over 40% of battery's charge, so I have flashed, by multiboot, a PR1.3 kernel (with no u-boot).
    After reboot the reported battery's charge was 10% (greater than before) and some mins after it has raised to 39%
  • It seems that bootmenu appears even with closed keyboard

mirakels 2011-10-13 07:05

Re: u-boot for the RX-51 (N900)
 
@fabry
comparing uboot+kp48 with pr13kernel seems wrong to see power consumption differences.
You should use kp48 with and without u-boot to do valid comparison tests.

pali 2011-10-13 07:26

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by Fabry (Post 1107983)
I made an attempt with the new kp48 image.

These are the problems found:
  • Power consumption problem is still present.
    Initially it seems that p. consumption is normal (discharge rate on idle = 1-3% / hour) but after 1-2 hours of continuos idle the situation changes and becomes "discharge rate on idle greater than 10% / hour"
  • Lcd screen is always powered on.
    Maemo never turns off it, it only shows a black screen (with backlight on, this is evident on a dark room)
  • There is problem with battery's charge measurement.
    I had 50% of reported battery's charge and I have rebooted the phone.
    After reboot reported battery's charge was only 7% and some mins after it was still 7%.
    I doubted that a boot process can really consume over 40% of battery's charge, so I have flashed, by multiboot, a PR1.3 kernel (with no u-boot).
    After reboot the reported battery's charge was 10% (greater than before) and some mins after it has raised to 39%
  • It seems that bootmenu appears even with closed keyboard

Yesterday I published new version which fixed problem with brightness and bootmenu with closed keyborad. Try again.

pali 2011-10-13 07:28

Re: u-boot for the RX-51 (N900)
 
And for battery capacity. If you used BME for value, nobody know how BME calculate it - so it may be good or bad. So for capacity please use calibrated battery and report value from bq27200.sh script (or from bq27x00_battery kernel module)

pali 2011-10-13 07:32

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by Hurrian (Post 1107931)
Holy ****, Pali! This is better than Multiboot! ;)
I'm going to measure power consumption before/after u-boot when I have time (probably this Saturday).

Can we have this by default in power50?

I'm planing this:

* Create uboot package which contains: uboot with pr1.3 kernel image (will be flashed); mkimage tool; new my tool/script for generating bootmenu.scr (to MyDocs) from /etc/bootmenu.d entries
* Kernel power will be installed by -bootimg package which call my new script which update bootmenu.scr (so no flashing kernel power image, will be loaded by uboot)
* Use same/similar configuration for fanoush bootmenu script (for /sbin/preinit) and script which generate bootmenu.scr

Rob1n 2011-10-13 08:15

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by pali (Post 1108026)
* Kernel power will be installed by -bootimg package which call my new script which update bootmenu.scr (so no flashing kernel power image, will be loaded by uboot)

Does this work for you? I'm unable to get kernel-power (or PR1.3) loaded via u-boot (other than via noloboot). It loads it in fine, but then looks to just hang at the start of the boot, before the watchdog eventually powers it off. The MeeGo and Nitdroid kernels work fine though - I've got MeeGo booting fully, but am still working on Nitdroid.

Also, any idea why I'm getting zero mtd devices found when booting the Nitdroid kernel? I see that the N900 u-boot configuration doesn't enable MTD at all, so would this be required for any booted kernels to access the MTD/UBI devices? I was planning on looking at this later today anyway and seeing what the other boards are doing to configure this.

mirakels 2011-10-13 09:46

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by Rob1n (Post 1108046)
Does this work for you? I'm unable to get kernel-power (or PR1.3) loaded via u-boot (other than via noloboot). It loads it in fine, but then looks to just hang at the start of the boot, before the watchdog eventually powers it off. The MeeGo and Nitdroid kernels work fine though - I've got MeeGo booting fully, but am still working on Nitdroid.

Also, any idea why I'm getting zero mtd devices found when booting the Nitdroid kernel? I see that the N900 u-boot configuration doesn't enable MTD at all, so would this be required for any booted kernels to access the MTD/UBI devices? I was planning on looking at this later today anyway and seeing what the other boards are doing to configure this.

Are the atags passed to the kernel? E.g. is this u-boot command given when sarting the pr1.3 kernel:

setenv atagaddr ${init_atagaddr};
.

I have the same problem with starting the nitdroid kernel without the atags. This is tricky cause I want to boot nitrdoid without touching the maemo root fs. I created an initramfs for nitroid and put that (and the u-boot nitdroid kernel) on the nitroid partition and can boot this. the whole kernel startup and switch to the nitroid root fs works fine but then the kernel hangs with panics about devices.

When I use above command before starting the nitdroid kernel all is well, but it still uses the maemo rootfs as an initrd.

I'm busy to update u-boot to the melt the nolo atags into a the ones u-boot creates itself(e.g. kernel commandline) and pass that to the kernel to boot...

Rob1n 2011-10-13 10:33

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by mirakels (Post 1108076)
Are the atags passed to the kernel? E.g. is this u-boot command given when sarting the pr1.3 kernel:

setenv atagaddr ${init_atagaddr};
.

No, I'm trying to boot to an initramfs so only used some of them. I'll check on that though.

Quote:

Originally Posted by mirakels (Post 1108076)
I have the same problem with starting the nitdroid kernel without the atags. This is tricky cause I want to boot nitrdoid without touching the maemo root fs. I created an initramfs for nitroid and put that (and the u-boot nitdroid kernel) on the nitroid partition and can boot this. the whole kernel startup and switch to the nitroid root fs works fine but then the kernel hangs with panics about devices.

Nitdroid absolutely requires access to the maemo rootfs. The firmware is loaded from there and it's even used post-boot, so just copying the firmware into the initramfs doesn't work either. My current plan is to use the initramfs to access the rootfs and setup multiboot so it thinks it's already flashed the nitdroid kernel. I can then switch_root into there and allow multiboot to do its stuff and pivot_root into the nitdroid filesystem. Unfortunately this requires access to the rootfs, which I can't do until I can get MTD (and then UBI) accessible.

ivgalvez 2011-10-13 11:30

Re: u-boot for the RX-51 (N900)
 
As far as I know, to use Nitdroid with Uboot, changes on Nitdroid boot process would be needed.

mirakels 2011-10-13 11:52

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by Rob1n (Post 1108096)
No, I'm trying to boot to an initramfs so only used some of them. I'll check on that though.



Nitdroid absolutely requires access to the maemo rootfs. The firmware is loaded from there and it's even used post-boot, so just copying the firmware into the initramfs doesn't work either. My current plan is to use the initramfs to access the rootfs and setup multiboot so it thinks it's already flashed the nitdroid kernel. I can then switch_root into there and allow multiboot to do its stuff and pivot_root into the nitdroid filesystem. Unfortunately this requires access to the rootfs, which I can't do until I can get MTD (and then UBI) accessible.

In that case your method seems complex.
I now start nitdroid via the maemo rootfs and pivot_root to the nitdroid partition.
So: u-boot loads the uImage from the nitdroid partitition. setup atags, and run bootm.
I adapted /sbin/preinit in maemo to recognise the kernel that is running
(ala multiboot config files) and switch to the nitdroid partiton.
This is pretty straight forward and runs fine.

Thanks though for pointing out about the firmware downloads.
When skipping the maemo/ubi rootfs and using my own initramfs I indeed saw one minute delays for downloading firmwares!

What is that about post-boot? Can you elaborate?

mirakels 2011-10-13 11:54

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by ivgalvez (Post 1108117)
As far as I know, to use Nitdroid with Uboot, changes on Nitdroid boot process would be needed.

I guess that depends on how you use uboot for that. As said above I can
load the uImage noitdroid kernel version from the nitdroi partition using u-boot and then go on like multiboot. That wayat least does not need constant reflashing of kernels!

Fabry 2011-10-13 12:32

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by pali (Post 1108023)
Yesterday I published new version which fixed problem with brightness and bootmenu with closed keyborad. Try again.

The tests has been executed on your yesterday's image with ms5sum = afe54f54bdc8bed716537f7438bfc4ae

This image reports (on boot) the date "Oct 12 2011 - 20:32:32"

Now I have redownloaded the image from your site and its md5sum has changed.
As date now it reports "Oct 12 2011 - 21:49:29"

So yesterday you have published two images

Rob1n 2011-10-13 12:35

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by mirakels (Post 1108127)
In that case your method seems complex.
I now start nitdroid via the maemo rootfs and pivot_root to the nitdroid partition.
So: u-boot loads the uImage from the nitdroid partitition. setup atags, and run bootm.
I adapted /sbin/preinit in maemo to recognise the kernel that is running
(ala multiboot config files) and switch to the nitdroid partiton.
This is pretty straight forward and runs fine.

Yes, my way is rather complex, but I want to avoid modifying the normal maemo boot process. I also know that the nitdroid boot process works with multiboot, so this should ensure everything required is run.

Quote:

Originally Posted by mirakels (Post 1108127)
Thanks though for pointing out about the firmware downloads.
When skipping the maemo/ubi rootfs and using my own initramfs I indeed saw one minute delays for downloading firmwares!

What is that about post-boot? Can you elaborate?

If you look at the multiboot script, it ends by using pivot_root to swap the nitdroid rootfs and the maemo rootfs, leaving the maemo rootfs mounted at /initrd. This is then used for loading firmware later (and possibly for other things, though I've not found any other references yet).

Fabry 2011-10-13 12:35

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by mirakels (Post 1108018)
@fabry
comparing uboot+kp48 with pr13kernel seems wrong to see power consumption differences.
You should use kp48 with and without u-boot to do valid comparison tests.

PR1.3 was the only fast solution to flash another kernel without u-boot and see if reported battery's charge was wrong (and it was)

pali 2011-10-13 12:36

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by pali (Post 1108023)
Yesterday I published new version which fixed problem with brightness and bootmenu with closed keyborad. Try again.

I mean that I yesterday released second fixed version :)

Fabry 2011-10-13 12:42

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by pali (Post 1108024)
And for battery capacity. If you used BME for value, nobody know how BME calculate it - so it may be good or bad. So for capacity please use calibrated battery and report value from bq27200.sh script (or from bq27x00_battery kernel module)

Values has been taken from BatteryGraph application (but the standard Maemo's battery widget on status bar showed the same false low battery state)

Rob1n 2011-10-13 15:43

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by Rob1n (Post 1108046)
Does this work for you? I'm unable to get kernel-power (or PR1.3) loaded via u-boot (other than via noloboot). It loads it in fine, but then looks to just hang at the start of the boot, before the watchdog eventually powers it off. The MeeGo and Nitdroid kernels work fine though - I've got MeeGo booting fully, but am still working on Nitdroid.

Also, any idea why I'm getting zero mtd devices found when booting the Nitdroid kernel? I see that the N900 u-boot configuration doesn't enable MTD at all, so would this be required for any booted kernels to access the MTD/UBI devices? I was planning on looking at this later today anyway and seeing what the other boards are doing to configure this.

I think I'm getting somewhere anyway. The MTD config is all defined in the atags, but using the default ones prevents you from adding any boot parameters, initrd, etc (as these are also encoded as atags). I think I'll need to copy the existing set and add the new ones to the end. This should be doable via scripts as a quick hack, but I think will need some modifications to u-boot for a proper solution.

Fabry 2011-10-13 16:34

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by Fabry (Post 1107983)
I made an attempt with the new kp48 image.

These are the problems found:
  • Power consumption problem is still present.
    Initially it seems that p. consumption is normal (discharge rate on idle = 1-3% / hour) but after 1-2 hours of continuos idle the situation changes and becomes "discharge rate on idle greater than 10% / hour"
  • Lcd screen is always powered on.
    Maemo never turns off it, it only shows a black screen (with backlight on, this is evident on a dark room)
  • There is problem with battery's charge measurement.
    I had 50% of reported battery's charge and I have rebooted the phone.
    After reboot reported battery's charge was only 7% and some mins after it was still 7%.
    I doubted that a boot process can really consume over 40% of battery's charge, so I have flashed, by multiboot, a PR1.3 kernel (with no u-boot).
    After reboot the reported battery's charge was 10% (greater than before) and some mins after it has raised to 39%
  • It seems that bootmenu appears even with closed keyboard

Problems on bold are still present on last image.
  • Power consumption is near 10% / hour on idle.
  • I have rebooted and from 79% battery level before reboot I have obtained a 59% battery level after reboot.
    Some mins after battery level was 58%.
    I don't know if it is a problem related to u-boot or a problem related to KP48

Furthermore I have noticed that first boot (noloboot) after a flash always fails (watchdog and then power off).
At least this happens with multiboot (i.e when from a PR1.3 kernel I switch to KP48+u-boot using multiboot the first maemo's boot always fails).
But I don't remember if this happens also with Matan's version

mirakels 2011-10-14 08:40

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by Rob1n (Post 1108262)
I think I'm getting somewhere anyway. The MTD config is all defined in the atags, but using the default ones prevents you from adding any boot parameters, initrd, etc (as these are also encoded as atags). I think I'll need to copy the existing set and add the new ones to the end. This should be doable via scripts as a quick hack, but I think will need some modifications to u-boot for a proper solution.

Yes, this is what I was planning to do by. I already added a command to u-boot to display the atags. Next thing I was planning to allow ading to the existing atags.

But I found something peculiar.
The atags do not contain any linux 'cmdline' information.
but somehow the maemo kernel is booted with several boot settings.
The atags on my devices are:
Code:

0000 - 0005:54410001 ATAG CORE flags=00000000 pagesize=00001000 rootdev=00000000
0020 - 0004:54410002 ATAG MEM size=10000000 start=80000000
0036 - 0003:54410007 ATAG REVISION revision=00002204
0048 - 0181:414f4d50 OMAP table
      0056 - 0004:4f07 UART: enabled ones (bitmask) 00000000
      0064 - 0036:4f05 LCD:          panel=acx565akm controller=internal nreset_gpio=005a data_lines=0018
      0104 - 0020:4f06 GPIO SWITCH:  cam_focus    : gpio=0044 flags=21 type=00 keycode=00000000
      0128 - 0020:4f06 GPIO SWITCH:  cam_launch  : gpio=0045 flags=21 type=00 keycode=00000000
      0152 - 0020:4f06 GPIO SWITCH:  cam_shutter  : gpio=006e flags=01 type=00 keycode=00000000
      0176 - 0020:4f06 GPIO SWITCH:  cmt_apeslpx  : gpio=0046 flags=22 type=00 keycode=00000000
      0200 - 0020:4f06 GPIO SWITCH:  cmt_bsi      : gpio=009d flags=22 type=00 keycode=00000000
      0224 - 0020:4f06 GPIO SWITCH:  cmt_en      : gpio=004a flags=22 type=00 keycode=00000000
      0248 - 0020:4f06 GPIO SWITCH:  cmt_rst      : gpio=004b flags=26 type=00 keycode=00000000
      0272 - 0020:4f06 GPIO SWITCH:  cmt_rst_rq  : gpio=0049 flags=26 type=00 keycode=00000000
      0296 - 0020:4f06 GPIO SWITCH:  cmt_wddis    : gpio=000d flags=22 type=00 keycode=00000000
      0320 - 0020:4f06 GPIO SWITCH:  headphone    : gpio=00b1 flags=11 type=00 keycode=00000000
      0344 - 0020:4f06 GPIO SWITCH:  kb_lock      : gpio=0071 flags=01 type=00 keycode=00000000
      0368 - 0020:4f06 GPIO SWITCH:  proximity    : gpio=0059 flags=00 type=00 keycode=00000000
      0392 - 0020:4f06 GPIO SWITCH:  sleep_ind    : gpio=00a2 flags=22 type=00 keycode=00000000
      0416 - 0020:4f06 GPIO SWITCH:  slide        : gpio=0047 flags=00 type=00 keycode=00000000
      0440 - 0008:4e02 WLAN CX3110X:  chip_type=25 power_gpio=5700 irq_gpio=2a00 spi_cs_gpio=ff00
      0452 - 0028:4f0b PARTITION:    bootloader      : size=00020000 offset=00000000 mask=00000003
      0484 - 0028:4f0b PARTITION:    config          : size=00060000 offset=00020000 mask=00000000
      0516 - 0028:4f0b PARTITION:    log              : size=00040000 offset=00080000 mask=00000000
      0548 - 0028:4f0b PARTITION:    kernel          : size=00200000 offset=000c0000 mask=00000000
      0580 - 0028:4f0b PARTITION:    initfs          : size=00200000 offset=002c0000 mask=00000000
      0612 - 0028:4f0b PARTITION:    rootfs          : size=0fb40000 offset=004c0000 mask=00000000
      0644 - 0012:4f80 BOOTREASON:  pwr_key   
      0660 - 0024:4f82 VERSION:      product      = RX-51     
      0688 - 0024:4f82 VERSION:      hw-build    = 2204       
      0716 - 0024:4f82 VERSION:      nolo        = 1.4.14     
      0744 - 0024:4f82 VERSION:      boot-mode    = normal     
      0772 - 0000:000 OMAP TABLE END
0772 - 0000:00000000 END ATAG

/proc/cmdline contains:

Code:

init=/sbin/preinit ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs rootflags=bulk_read,no_chk_data_crc rw console=ttyMTD,log console=tty0 snd-soc-rx51.hp_lim=42 snd-soc-tlv320aic3x.hp_dac_lim=6
So I wonder where does the cmdline info come from...

pali 2011-10-14 10:15

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by mirakels (Post 1108602)
So I wonder where does the cmdline info come from...

default cmdline can be compiled into kernel image (see CONFIG_CMDLINE in arch/arm/configs/rx51_defconfig in linux kernel)

also flasher-3.5 can send cmdline via param -b

Fabry 2011-10-14 16:08

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by pali (Post 1108623)
also flasher-3.5 can send cmdline via param -b

And of course u-boot also with setenv bootargs

But if I have read correctly, he tells that the cmdline sent is ignored if atag is used

mirakels 2011-10-14 17:25

Re: u-boot for the RX-51 (N900)
 
Ah, ok. so apperantly the kernel uses the compiled-in as default when no other is passed. The default atags passed by nolo do not contain a cmdline tag so the kernel uses this default.

When you tell uboot to use the atags from nolo it does not pass any other atags so bootarg settings will be ignored.

pali 2011-10-14 17:30

Re: u-boot for the RX-51 (N900)
 
if env atagaddr is defined (by default address from NOLO - register r2) then cmdline argument configured by uboot is ignored. If you want to pass your own cmdline from uboot, first clear env atagaddr (setenv atagaddr)

Fabry 2011-10-14 22:04

Re: u-boot for the RX-51 (N900)
 
But atagaddr is not empty as default ?

Only if it is executed the script "noloboot" atagaddr is filled with ${init_atagaddr};

pali 2011-10-14 22:26

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by Fabry (Post 1108906)
But atagaddr is not empty as default ?

Only if it is executed the script "noloboot" atagaddr is filled with ${init_atagaddr};

I check this and yes, you are right. uboot has two variables: atagaddr and init_atagaddr. atagaddr is used for booting and init_atagaddr is filled when uboot is loading. script noloboot set atagaddr from init_atagaddr

mirakels 2011-10-15 17:08

Re: u-boot for the RX-51 (N900)
 
my u-boot now allows to copy the initial atags and append cmdline and ramdisk images to it.
Nitdroid now comes up without panics, completely ignoring the maemo rootfs.
Only thing still is the firmware. I'll probably just copy the firmware files tot hte nitdroid partition. Will test later tonight.

Rob1n 2011-10-16 21:48

Re: u-boot for the RX-51 (N900)
 
1 Attachment(s)
Quote:

Originally Posted by mirakels (Post 1109226)
my u-boot now allows to copy the initial atags and append cmdline and ramdisk images to it.
Nitdroid now comes up without panics, completely ignoring the maemo rootfs.
Only thing still is the firmware. I'll probably just copy the firmware files tot hte nitdroid partition. Will test later tonight.

Finally got it all working :D I can now boot into Maemo, Meego or Nitdroid without needing to reflash or change cards. I've attached the patch to u-boot I'm using - it appends the initrd and command line (if set) to the atags instead of just ignoring them when atagaddr is set.

For Nitdroid, I'm using multiboot as normal, but fooling it into thinking it's already done the reflash, so it just loads Nitdroid straight away. If anyone's interested, I can also post my initramfs and u-boot scripts.

mirakels 2011-10-17 07:39

Re: u-boot for the RX-51 (N900)
 
1 Attachment(s)
same here.

But my attempts to boot without using the maemo rootfs fail.Nitdroid needs the maemo rootfs to start all kinds of daemons for 'propriety' functions like bme and also starts things like dbus from the maemo partition.
I guess this can all be fixed by copying a couple of maemo files to the nitdroid partition, but it needs lots of changes to the nitdroid startup code.

So the nitdorid port is not really an native port... Pitty.
But the important things is we can boot nitdroid (and others) without reflashing!

anyway here is my version of the u-boot update. It uses an environment variable "atagcopy" to indicate you want to copy the existing atags and append new ones to it. e.g. something like:

setenv atagcopy $init_atagaddr
setenv bootargs root=/dev/mmcblk0p5
loadext2 .... $loadaddr uImage
loadext2 .... $ramfsaddr uInitramfs
bootm $loadaddr $ramfsaddr

Hurrian 2011-10-17 09:47

Re: u-boot for the RX-51 (N900)
 
I can't seem to see anything weird in powertop before and after installing u-boot, but the battery applet's been acting weird. No idea where the power consumption's going (shouldn't Linux take control of all the devices when it starts?)

ildar 2011-11-01 11:25

Re: u-boot for the RX-51 (N900)
 
u-boot is a nice piece of software.
I just stuck with
1. loading initramfs. Could you please show a command for that?
2. I've seen fatload working (once). How can I do the same for ext2. Example?
3. Most recent u-boot+PR1.3 kernel -? At http://al.robotfuzz.com/~al/maemo/u-boot/ ?

Rob1n 2011-11-01 11:40

Re: u-boot for the RX-51 (N900)
 
Quote:

Originally Posted by ildar (Post 1116784)
u-boot is a nice piece of software.
I just stuck with
1. loading initramfs. Could you please show a command for that?
2. I've seen fatload working (once). How can I do the same for ext2. Example?
3. Most recent u-boot+PR1.3 kernel -? At http://al.robotfuzz.com/~al/maemo/u-boot/ ?

1. You can load the initramfs by doing "fatload mmc 0:3 0x83000000 initrd.img" and then boot it by doing "bootm 0x82000000 0x83000000".
2. As well as fatload, there's a corresponding ext2load which you can use in the same way.
3. The latest u-boot (AFAIK) is at http://atrey.karlin.mff.cuni.cz/~pali

pali 2011-11-11 17:16

Re: u-boot for the RX-51 (N900)
 
Good news :)

I found a way how to get address where was u-boot loaded by NOLO and where u-boot expect start address in any C or ASM code (not only in start.S). So relocation of u-boot binary to correct address is possible in any source file.

It is very tricky. In one section will be stored address of that section generated by compiler (this address will correct after reloacation). And also it is possible to get address where is really that section stored.

assembler code:
Code:

relocaddr:
.word .

and in same file will be calculating offset (saved in r0):
Code:

adr        r0, relocaddr @real address of section
ldr        r1, relocaddr @correct address of section after relocation
sub        r0, r0, r1 @calculate offset

after that it is possible to move relocation code from armv7/start.S to rx51 board code and maybe this solution can be accepted in upstream.


All times are GMT. The time now is 16:21.

vBulletin® Version 3.8.8