| Prev |   1     2   3   4     5   | Next | Last
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)

Hurrian 2011-09-26 22:29

Re: u-boot for the RX-51 (N900)
 
Cool, finally, progress towards booting Maemo from eMMC without using mtd5.

By the way, I think that with this, we can finally mess with getting rid of /sbin/preinit (which imo is a huge WTF) without risking a reflash! (initrd runs backupmenu if it sees slide open? recovery OS from u-boot?)

Rob1n 2011-09-27 07:56

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

Originally Posted by Fabry (Post 1096939)
But Cpio does not involve the use of EXT2 ?
Cpio Is just a archive format, but when the kernel, during boot process, decompresses the cpio image on ramfs does not try to use EXT2 ?

It shouldn't involve ext2, no, the cpio is extracted to tmpfs.

mirakels 2011-09-27 08:55

Re: u-boot for the RX-51 (N900)
 
So the cpio archive could be a way to go.
Then it comes to what exactly is needed to setup a prerootfs to boot from.
The multiboot script creates loads of device nodes and insmods many modules. I guess this can be simplified.

I think we only need /dev/console and the mmcblk devices and only need to load the ext2 module to access the real root filesystem.
All other stuff should be done by the init command on the real root filesystem.

Or am I missing something.

Radicalz38 2011-09-28 10:34

Re: u-boot for the RX-51 (N900)
 
@Pali
Could you compile your bootmenu patch against stskeeps' version of u-boot? I tried compiling al's latest u-boot(clean) and caused the same reboot loop so I decided to try compiling stskeeps version of u-boot and merged with kp49 and it worked flawlessly on my device. So my request is could you provide a compiled version of u-boot.bin that is patched with stskeeps u-boot for some of us who are having problems with the current u-boot? I'm not really good at these patch & diff thingy that's why I am asking if you could do it?


Thanks and I hope you would be reconsidering my request :o

pali 2011-09-28 10:49

Re: u-boot for the RX-51 (N900)
 
bootmenu patches rebased on top of matan (origin ali/stskeeps) version are in branch pali: https://gitorious.org/u-boot-shr/u-boot/commits/pali

pali 2011-09-28 10:56

Re: u-boot for the RX-51 (N900)
 
All versions of u-boot (expect mine) need to have enabled R&D mode with disabled watchdogs. Mine version should not boot default Maemo5 correctly with enabled R&D.

So try boot mine version version again but disable R&D mode

Problem is with watchdog...

Fabry 2011-09-28 12:19

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

Originally Posted by pali (Post 1098019)
All versions of u-boot (expect mine) need to have enabled R&D mode with disabled watchdogs.

Matan's version (Nov 2010) has watchdog code (you can stay on console as long you want).
This at least on Hw Rev 2101

pali 2011-09-28 12:44

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

Originally Posted by Fabry (Post 1098078)
Matan's version (Nov 2010) has watchdog code (you can stay on console as long you want).
This at least on Hw Rev 2101

Mine has code for watchdog too. But matan's version totaly disable watchdog (so if you tried boot bad/broken/unbootable kernel you will need to restart phone with battery!). My version kick watchdog every 2s (when U-Boot is active). When U-Boot is stopped (started kernel) there is time 30s to kick watchdog again (prevent restart) which is then handled by os kernel... But this is bad behaviour: If device is in R&D mode with CAL flag disabled-watchog Maemo5 think that watchdog is disable and never kick it...

kinggo 2011-10-01 08:11

Re: u-boot for the RX-51 (N900)
 
well, I have to admit that I'm lost in all this. Before I was using kp v45 with u-boot and everything was working fine. But then my N900 kind of died. Now I have a new one with kp v48 so can someone tell me which u-boot should I install that is compatible with kp v48 so I can boot new release of MeeGo?

Radicalz38 2011-10-02 00:45

Re: u-boot for the RX-51 (N900)
 
Hi pali.... Seems like matan's version of u-boot ain't working for me. But if I compile stskeep's(no modifications) version directly U-Boot seems working fully. Could you also create one from stskeeps version? Without matan's patches just yours on stskeeps version?

pali 2011-10-02 07:36

Re: u-boot for the RX-51 (N900)
 
No, I will not rebase all patches on top of old u-boot tree. If somebody want can do it (all patches and branches are on gitorious). I'm prepairing rx-51 patches for merging into upstream.

Matan branch has only few commits ahead of stskeep. So you can use git bisect to find commit which break your device. Please let me know where is problem. I'd like to see that commit and fix it.

Radicalz38 2011-10-02 07:42

Re: u-boot for the RX-51 (N900)
 
Thanks will do after weekends will look into git bisect first as I have no idea what it is yet :p

pali 2011-10-02 07:45

Re: u-boot for the RX-51 (N900)
 
See manpage for git-bisect

Code:

git-bisect - Find by binary search the change that introduced a bug

Fabry 2011-10-02 10:04

Re: u-boot for the RX-51 (N900)
 
I have found out a very very strange problem.

When I use Pali's u-boot image (with power kernel v48) I have a very high power consumption on stand-by/idle
A full charged battery discharge to empty in only 12-13 hours instead of many days.

I have done some tests and I can confirm that on my phone (rev 2101):
- With PR1.3 kernel (no u-boot) = normal power consumption
- With Power kernel v48 with Matan's U-Boot = normal power consumption
- With Power kernel v48 with Pali's U-Boot (prebuild image supplied by Pali) = very high power consumption

Unfortunately I don't understand why

pali 2011-10-02 10:16

Re: u-boot for the RX-51 (N900)
 
I have same problem with battery. It happends if I boot my builded u-boot binary. kernel-power wihout u-boot is ok. So this must be problem in u-boot.... But now I do not know where...

mirakels 2011-10-03 16:53

Re: u-boot for the RX-51 (N900)
 
i noticed the powerconsumption too.
maybe it has to do with twl4030 settings or with the C4-C0 state checkings.
I ran powertop and noticed hign persentage of Cx compare to others...

mirakels 2011-10-03 19:56

Re: u-boot for the RX-51 (N900)
 
I'm about to give up.
u-boot can't seem to find the internal emmc and 'external' sdcard cards anymore.
'mmc init 0' should give the external sdcard, 'mmc init 2' should give the internal emmc card. But these command just return 'no MMC card'.

The strange thing is sometimes 'mmc init 1' does work and allows access to the external sdcard.

Just booting noloboot is still no problem and shows both mmc available...

Anybody any hints?

pali 2011-10-07 23:20

Re: u-boot for the RX-51 (N900)
 
Bad: Now I'm testing all version of u-boot (all branches from gitorious) but no version can access to internal eMMC. I do not know where is problem...

And some good news, I fixed problem with scrolling console.

mirakels 2011-10-08 10:53

Re: u-boot for the RX-51 (N900)
 
Pali, I was doing the same. Even took the master from denx.de

Sometimes it does work and I see the emmc (but not the external sdcard).
I think the best change of getting it is start up o in plain maemo and then do a reboot (or power off) from the power-button menu.

I think it is just u-boot not properly initialising the twl403 MMC pins. I'm also looking at the linux kernel sources on how mmc is inititialised (e.g. the nokia patches) and it seems linux is doing a lot more stuff than u-boot does (e.g. initialising clocks).

mirakels 2011-10-08 10:58

Re: u-boot for the RX-51 (N900)
 
@pali, did you uplaod the fix for console scrolling somewhere? Thanks!

pali 2011-10-08 11:41

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

Originally Posted by mirakels (Post 1105156)
I think it is just u-boot not properly initialising the twl403 MMC pins. I'm also looking at the linux kernel sources on how mmc is inititialised (e.g. the nokia patches) and it seems linux is doing a lot more stuff than u-boot does (e.g. initialising clocks).

I never see eMMC working on my n900 in u-boot. And now I do not have SD card for testing. (I'm waiting for deliver one 32GB) You are right that eMMC is not power on (mux?, twl4030? voltage?). I spend more than 6 hours finding problem (in u-boot, n900 kernel...), but without success. Now U-Boot migrated to generic mmc driver, see rx51 patch: http://gitorious.org/u-boot-shr/u-bo...380ea422d26689

When using this new generic mmc driver, U-Boot tell me that mmc0 (should be external slot?) has bad voltage (Ok, when card is not inserted?). I tried enable mmc1 (omap_mmc_init(1); should be eMMC), no error shown, initialization OK, but again not working... Also tried mmc2, mmc3, ... but that initialization failed.

U-Boot: Some MUXes are in board/nokia/rx51/rx51.h under section Wireless LAN (why?), GPIO_130 - GPIO_139. And initializing mmc is in drivers/power/twl4030.c function twl4030_power_mmc_init

Quote:

Originally Posted by mirakels (Post 1105163)
@pali, did you uplaod the fix for console scrolling somewhere? Thanks!

Not now. I'm rebasing patches again and trying to fix other things...
If I think that new patches could be stable I will push it into gitorious.

Console fix patch is attached.

mirakels 2011-10-08 12:17

Re: u-boot for the RX-51 (N900)
 
Thanks for the patch Pali. A while ago I defined a 'clr' u-boot command to clear the screen so I could avoid going into the garbled screen mode.
I also spend several evenings trying to figure out how to get the mmcs online :(
Also tried omap_mmc_init(x) wiht x=0,1,2. Added some twl4030_i2c calls to set voltage to MMC2 and VAUX3 (If I understand it correctly older n900 models need MMC2, newer ones VAUX3 pins). Maybe newer models have wireless ALN on MMC2 now hence the GPIO_130-139 stuff...

I also noticed that twl403_power_mmc_init() is called by uboot but twl4030_power_init() is not. I added this function bit it did not help either...

One other thing. I defined a u-boot backlight command to set the backlight level of the screen. Other the n900 starts up with a very dim screen. Using this command I can get a readable screen again. For now it is just a hack.

I use generic_mmc too as I rebased on the latest denx master. apperantly the mmc naming scheme is changed by that. when I have an available mmc its is mmc1 and that indeed is the eMMC (so these times I was able to boot android as I installed nitdroid (and kernel and initramfs) on eMMC partition 5).

pali 2011-10-08 12:31

Re: u-boot for the RX-51 (N900)
 
backlight support is good. I looked into U-Boot but it does not have any brightness/backlight interface. So setting initial level should be in misc_init_r (rx51.c) Can you create patch for that? I will include it into my patch series (for gitorious)

pali 2011-10-08 12:48

Re: u-boot for the RX-51 (N900)
 
Now I got eMMC working :) I will try to find which function it activated and create clean patch :)

mirakels 2011-10-08 13:56

Re: u-boot for the RX-51 (N900)
 
i'll make the patches available.

About the fixed console scrolling. I also tried this way before but it did not work for me then. But surely

for ( i = 1; i < CONSOLE_COLS; ++i )

cant be correct. Although it results in proper screens, I see collorerd garbage on the last line while scrolling.
I guess it should be

for ( i = 1; i < CONSOLE_ROWS; ++i )

but when I try that the garbage stays. Very weird.
With some experiments I figured

for ( i = 1; i < 4*CONSOLE_ROWS; ++i )

seems to work fine, with the collored garbage on the last line...
I am puzzeled while. Is the framebuffer bigger than anicipate. Does the n900 use double buffering????

pali 2011-10-08 17:01

Re: u-boot for the RX-51 (N900)
 
2 Attachment(s)
Here are patches which enable eMMC support (working on my n900, hw revision 2101).

Fabry 2011-10-08 17:35

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

Originally Posted by pali (Post 1105187)
I never see eMMC working on my n900 in u-boot.

On Matan's version eMMC works (with "mmc init 2") but only if Maemo has been booted before entering on u-boot's console.

pali 2011-10-08 17:38

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

Originally Posted by Fabry (Post 1105464)
On Matan's version eMMC works (with "mmc init 2") but only if Maemo has been booted before entering on u-boot's console.

matan version is based on old u-boot code... see my patches which fix emmc support

Fabry 2011-10-08 17:41

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

Originally Posted by pali (Post 1105439)
Here are patches which enable eMMC support (working on my n900, hw revision 2101).

Good to hear!

News on power consumption problem ?

pali 2011-10-08 17:45

Re: u-boot for the RX-51 (N900)
 
No, first I'm trying to make working version of u-boot...

mirakels 2011-10-08 20:06

Re: u-boot for the RX-51 (N900)
 
5 Attachment(s)
Pali, here are my patches. On top of your scollup fix I added a fix to use the memsetl() again.
Furthermore the clearscreen stuff and some cosmetic changes/fixes.

mirakels 2011-10-08 20:07

Re: u-boot for the RX-51 (N900)
 
1 Attachment(s)
and the backlight patch

pali 2011-10-08 21:57

Re: u-boot for the RX-51 (N900)
 
First thanks for patches!

My comments:

0001-RX51-bootmenu-add-clr-command-to-clear-the-screen.patch.txt - Please add definitions directly to include/config_cmd_default.h and include/config_cmd_all.h (not into rx51)

0002-RX51-cfb_console-fix-cursor_fix-checks.patch.txt 0003-RX51-cfb_console-console_clear_line-fix-refacored-li.patch.txt - Thanks, this is reason why sometimes I got some bad pixels. I melt this patch into my series.

0004-drivers-video-cfb-console.c-Fix-function-console_scr.patch 0005-cfb_console-fix-console_scrollup.patch.txt - patches deleted (see below)

0006-RX51-add-command-to-set-screen-backlight.patch - there is missing some files in this patch. But we do not want to add new specific command only for n900 (not usefull for upstream). And I tested this patch and it break brightness in Maemo kernel. When I used this patch I was not able to change brightness in Maemo (via controlpanel or sysfs). Can you look at this error?

===

Correct implementation of function console_scrollup is:
memcpyl(CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND, CONSOLE_SCROLL_SIZE);

CONSOLE_SCROLL_SIZE is full, not without first 2 bits! This is working fine now.

When I finish my patch series, I will commit all into gitorious

mirakels 2011-10-09 10:11

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

Originally Posted by pali (Post 1105711)
0001-RX51-bootmenu-add-clr-command-to-clear-the-screen.patch.txt - Please add definitions directly to include/config_cmd_default.h and include/config_cmd_all.h (not into rx51)

I see what you mean. See attachment for a new version.
To enable the command for rx51 I guess you still need to add the define to rx51.h manually.

Quote:

Originally Posted by pali (Post 1105711)
0006-RX51-add-command-to-set-screen-backlight.patch - there is missing some files in this patch. But we do not want to add new specific command only for n900 (not usefull for upstream). And I tested this patch and it break brightness in Maemo kernel. When I used this patch I was not able to change brightness in Maemo (via controlpanel or sysfs). Can you look at this error?

Yes that is why I added the big WARNING. I noticed the brightness problem too but when I set backlight to 0 just before booting a kernel this problem seems to be gone.

What files are you missing?

The reason that I added it in the n900 specific part is that I'm not sure if the command is useful on other devices. I guess that is the reason you added the regulator patches to the rx51.c file too. If they are generic enough I guess the regulator and backlight code could be moved to power/twl4030.c
or friends.

Quote:

Originally Posted by pali (Post 1105711)
Correct implementation of function console_scrollup is:
memcpyl(CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND, CONSOLE_SCROLL_SIZE);

CONSOLE_SCROLL_SIZE is full, not without first 2 bits! This is working fine now.

CONSOLE_SCROLL_SIZE reflects the number of bytes in the scroll area. but memcpyl() moves ints! To reflect the weirdness in this I think you should still use

memcpyl(CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND, 4*CONSOLE_SCROLL_SIZE >> 2);

PS: maybe you should consider pushing the ANSI and bootmenu patches to denx asap. They are quite useful for everybody right now!

And great you figured about the regulator stuff to enable the mmc cards!

Fabry 2011-10-09 10:27

Re: u-boot for the RX-51 (N900)
 
These future N900 u-boot's images will have a working saveenv command or other solutions to persist modification to env ?

pali 2011-10-09 10:50

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

Originally Posted by Fabry (Post 1105896)
These future N900 u-boot's images will have a working saveenv command or other solutions to persist modification to env ?

no. but it eMMC part1 (MyDocs) now is workinf so it can be used for this. (but someone must write patch which will use this) but I think that saveenv is not needed...

I'm prepairing rx51 config to load bootmenu configuration from eMMC part1 file bootmenu.scr. So changing bootmenu entires wil not need to recompile u-boot. So in Maemo (or in all other systems) will be ulility update-uboot which update bootmenu.scr file in eMMC (MyDocs). We can use similar configuration file like in bootmenu/multiboot for configuring menu entires. And for security, if keyboard will be closed this file will be ignored (so if somebody damage this file, still can boot maemo5 in internal flash)

pali 2011-10-09 11:02

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

Originally Posted by mirakels (Post 1105889)
I see what you mean. See attachment for a new version.
To enable the command for rx51 I guess you still need to add the define to rx51.h manually.

yes, ok. it is needed in rx51 and cmd_all

Quote:

Originally Posted by mirakels (Post 1105889)

Yes that is why I added the big WARNING. I noticed the brightness problem too but when I set backlight to 0 just before booting a kernel this problem seems to be gone.

yes, this is reason why not to upstream this patch. We need look how maemo kernel set brightness!

Quote:

Originally Posted by mirakels (Post 1105889)

What files are you missing?

that for command - but this was only for rx51, so command can be deleted!

Quote:

Originally Posted by mirakels (Post 1105889)

The reason that I added it in the n900 specific part is that I'm not sure if the command is useful on other devices. I guess that is the reason you added the regulator patches to the rx51.c file too. If they are generic enough I guess the regulator and backlight code could be moved to power/twl4030.c
or friends.


CONSOLE_SCROLL_SIZE reflects the number of bytes in the scroll area. but memcpyl() moves ints! To reflect the weirdness in this I think you should still use

memcpyl(CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND, 4*CONSOLE_SCROLL_SIZE >> 2);

And (4*CONSOLE_SCROLL_SIZE >> 2) is not same as CONSOLE_SCROLL_SIZE? Byteshift (C >> 2) is same as (C/4), so (4*C >> 2) = (4*C/4) = C

Quote:

Originally Posted by mirakels (Post 1105889)


PS: maybe you should consider pushing the ANSI and bootmenu patches to denx asap. They are quite useful for everybody right now!

Sorry, but my bootmenu will not be upstreamed. In upstream will be other implementation of bootmenu (like config for pxecfg) by someone else.

Quote:

Originally Posted by mirakels (Post 1105889)

And great you figured about the regulator stuff to enable the mmc cards!

this could be tested on more HW revisions first! It working on my 2101. Do you have other HW rev?

Fabry 2011-10-09 12:44

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

Originally Posted by pali (Post 1105913)
And (4*CONSOLE_SCROLL_SIZE >> 2) is not same as CONSOLE_SCROLL_SIZE? Byteshift (C >> 2) is same as (C/4), so (4*C >> 2) = (4*C/4) = C

It's not the same.

(4*C>>2) = ((C<<2)>>2) = clear two most significative bits

For example suppose C as byte (unsigned):

If C = 46 (0010 1110) then (4*C>>2) = 46 (0010 1110) also, but if C = 114 (0111 0010) then (4*C>>2) = 50 (0011 0010)

mirakels 2011-10-09 13:06

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

Originally Posted by pali (Post 1105913)
yes, this is reason why not to upstream this patch. We need look how maemo kernel set brightness!

brightness seems to be on higher levels. in de nokia patches. I had a quick look but do not see any direvt twl or i2c calls doing brightess.

I took the backlight code right from the kernel source however.

Quote:

Originally Posted by pali (Post 1105913)
And (4*CONSOLE_SCROLL_SIZE >> 2) is not same as CONSOLE_SCROLL_SIZE? Byteshift (C >> 2) is same as (C/4), so (4*C >> 2) = (4*C/4) = C

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.

Quote:

Originally Posted by pali (Post 1105913)
this could be tested on more HW revisions first! It working on my 2101. Do you have other HW rev?


I have 2204. My previous on was a 2104 I think (not sure though) and u-boot worked fine with that model too.

pali 2011-10-09 13:12

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

Originally Posted by Fabry (Post 1105950)
It's not the same.

(4*C>>2) = ((C<<2)>>2) = clear two most significative bits

For example suppose C as byte (unsigned):

If C = 46 (0010 1110) then (4*C>>2) = 46 (0010 1110) also, but if C = 114 (0111 0010) then (4*C>>2) = 50 (0011 0010)

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



| Prev |   1     2   3   4     5   | Next | Last
All times are GMT. The time now is 21:57.

vBulletin® Version 3.8.8