View Single Post
Posts: 20 | Thanked: 27 times | Joined on May 2019 @ Sydney, Australia
#15
Message 9 / 9

I also don't even have a working serial console. I've tried all of these console devices, all to no effect:
  • ttyS1
  • ttyS2
  • ttyS3
  • ttyO1
  • ttyO2
  • ttyO3
  • tty01
  • tty02
  • tty03
  • ttyAMA0
  • ttyAMA1

Adding init=/bin/sh completely blocks the boot pretty much immediately, so this tells me where/when the kernel initialization is taking place and equivalently when/where I should definitely be seeing tty output. No dice though.

So... even though I can boot OS2008 in the N800, I don't consider this successful as I can't really use the resulting device. I can't get GVM into it, for starters!!

I'm not entirely sure how this is working at all though to be honest. At one point when using r4980 and RX-34-RX-34_2008SE_1.2007... I think .44-4, nothing was working, and straceing qemu-system-arm showed that it was slowly lseeking around and lazily reading the flash. And then something twigged internally inside the VM and QEMU went into a hard loop executing clock_gettime 20,000 times a second. That was weird. It didn't emit any more lseeks or reads after going into that hard loop, so after giving it a few moments, I ^C'd it.


Trying to run same QEMU using -M n810: nnnope

-M N810 just results in

Code:
$ ~/debian4/root/qemu-svnr6679/arm-softmmu/qemu-system-arm -kernel zImage -M n810 -mtdblock n810.img -m 130 -append "root=/dev/mtdblock3 rootfstype=jffs2"
mipid_reset: Display off
^C
and

Code:
$ ~/debian4/root/qemu-svnr4980/arm-softmmu/qemu-system-arm -kernel zImage -M n810 -mtdblock n810.img -m 130 -append "root=/dev/mtdblock3 rootfstype=jffs2"
mipid_reset: Display off
^C
no matter how long I leave them for. I get the impression QEMU is just spinning and not doing anything (no disk seeks etc).

I tried the partition table change noted at https://talk.maemo.org/showpost.php?p=211906 but to no effect.

I think something's deadlocking waiting for some emulated hardware to enter a certain state or something. I've had a look at hw/nseries.c but that's just poking lots of magic values into registers. I tried forcing the N800 model to also initialize the N810 keyboard, but that didn't work (I would have been very surprised if it did). Chances are the deadlock would probably be debugged/fixed from hw/omap2.c, which... I am slightly not so inclined to want to touch :P

NOTE. I am intrigued to emulate an N series device in QEMU but I am hesitant this will get me any closer to my goal - Xomap provides the exact GL environment that Hildon is expecting, and my goal here is reproducing this GL environment (software-emulated or not - I really really don't care) with vanilla Debian.


Trying to run OS2009 on N900: insufficient instructions found

I cannot find good instructions on how to run OS2009 on an N900.

In fact am uncertain this endeavour would be successful - https://talk.maemo.org/showpost.php?p=591969 notes that QEMU did not have SGX graphics support back in 2010, and looking in the source code today, I'm uncertain how to interpret what I see - there are not that many references to "SGX" and "sgx":

Code:
$ rg SGX
hw/arm/omap3.c
93:    {0x0400, L3TYPE_IA},     /* SGXSS_IA */
110:    {0x0400, L3TYPE_TA},     /* SGXSS_TA */
1673:        /* SGX_PRM */
1678:            /* TODO: support SGX wakeup control. For now let's keep the
1679:             * SGX domain always in ON state, never changing */
1996:    /* SGX_CM: base + 0x0b00 */
2648:        /* SGX_CM */
2857:        /* SGX_CM */
2860:        case 0xb40: s->cm_clksel_sgx = value; break; /* TODO: SGX clock */

include/hw/arm/omap.h
482:#define OMAP_INT_3XXX_SGX_IRQ       21 /* 2D/3D graphics module */
Code:
$ rg sgx
hw/arm/omap3.c
1254:    struct omap3_prm_domain_s sgx;
1356:    memset(&s->sgx, 0, sizeof(s->sgx));
1357:    s->sgx.rm_rstst     = 0x1;
1358:    s->sgx.pm_wkdep     = 0x16;
1359:    s->sgx.pm_pwstctrl  = 0x30107;
1360:    s->sgx.pm_pwstst    = 0x3;
1439:        case 0x0b: d = &s->sgx; break;
1674:        case 0x0b58: s->sgx.rm_rstst &= ~(value & 0xf); break;
1675:        case 0x0bc8: s->sgx.pm_wkdep = value & 0x16; break;
1677:            s->sgx.pm_pwstctrl = 0x030104 | (value & 0x3);
1680:            s->sgx.pm_pwstst = 0x3;
1681:            s->sgx.pm_prepwstst = s->sgx.pm_pwstst;
1997:    uint32_t cm_fclken_sgx;    /* 00 */
1998:    uint32_t cm_iclken_sgx;    /* 10 */
1999:    uint32_t cm_idlest_sgx;    /* 20 */
2000:    uint32_t cm_clksel_sgx;    /* 40 */
2001:    uint32_t cm_sleepdep_sgx;  /* 44 */
2002:    uint32_t cm_clkstctrl_sgx; /* 48 */
2003:    uint32_t cm_clkstst_sgx;   /* 4c */
2527:    s->cm_fclken_sgx = 0x0;
2528:    s->cm_iclken_sgx = 0x0;
2529:    s->cm_idlest_sgx = 0x1;
2530:    s->cm_clksel_sgx = 0x0;
2531:    s->cm_sleepdep_sgx = 0x0;
2532:    s->cm_clkstctrl_sgx = 0x0;
2533:    s->cm_clkstst_sgx = 0x0;
2649:        case 0x0b00: return s->cm_fclken_sgx;
2650:        case 0x0b10: return s->cm_iclken_sgx;
2651:        case 0x0b20: return s->cm_idlest_sgx & 0x0;
2652:        case 0x0b40: return s->cm_clksel_sgx;
2653:        case 0x0b44: return s->cm_sleepdep_sgx;
2654:        case 0x0b48: return s->cm_clkstctrl_sgx;
2655:        case 0x0b4c: return s->cm_clkstst_sgx;
2858:        case 0xb00: s->cm_fclken_sgx = value & 0x2; break;
2859:        case 0xb10: s->cm_iclken_sgx = value & 0x1; break;
2860:        case 0xb40: s->cm_clksel_sgx = value; break; /* TODO: SGX clock */
2861:        case 0xb44: s->cm_sleepdep_sgx = value & 0x2; break;
2862:        case 0xb48: s->cm_clkstctrl_sgx = value & 0x3; break;
The instructions for booting N900s seem very different to N8x0 series devices: https://talk.maemo.org/showpost.php?p=879015

I tried googling the listed filenames for fun, and this led me to find http://46.249.74.23/qemu/, which contains the exact files mentioned in the command!

What's very nice is that this setup automatically routes Linux to the tty console:

Code:
$ /data/qemu-linaro/arm-softmmu/qemu-system-arm -M n900 -mtdblock RX-51_2009SE_20.2010.36-2.nand -sd RX-51_2009SE_20.2010.36-2.emmc -serial mon:stdio -clock unix -redir tcp:2224:10.0.2.15:22 -redir tcp:13219:10.0.2.15:10000  

(process:29852): GLib-WARNING **: 00:01:44.551: ../glib/glib/gmem.c:490: custom memory allocation vtable not supported
NOLO X-Loader (v1.4.14, Jun  3 2010)
Secondary image size 98440
Booting secondary
[   0.001] Nokia OMAP Loader v1.4.13 (Dec  1 2009) running on Nokia N900 S4.0 GP (RX-51)
[   0.013] I2C v3.12
[   0.018] System DMA v4.0
[   0.024] OneNAND device ID 0040, version ID 0121 (256 MiB, 66 MHz)
[   0.036]   OneNAND blocks unlocked in 18055 us
[   0.042]   Flash id: ec4021
[   0.062] Partition table successfully read
[   0.197] TWL4030 PWR ISR: 01
[   0.199] Forcing power key boot reason (R&D flag set)
[   0.203] Reset reason: pwr_key
[   0.205] McSPI v2.1
[   0.208] ERROR: LP5523 not found
[   0.210] SMB138C: Not loading driver (version reg. 0x49)
[   0.213] BQ24150 (rev. 1) found on I2C bus 1, address 0x6b
[   0.214] SSI version 1.0
[   0.215] Battery voltage 6.012 V, BSI: 0
[   0.215] Disabling charging (R&D flag set)
[   0.216] Initializing LCD panel
[   0.216]   Detecting LCD panel moscow
[   0.218]     Panel ID: 101234
[   0.218]   Detected LCD panel: acx565akm
[   0.218] DISPC: version 3.0
[   0.222]   LCD pixel clock 24000 kHz
[   0.231]   Logo drawn in 15 ms (3900 kB/s)
[   0.359]   Über-cool backlight fade-in took 128 ms
[   0.360] Initializing USB
[   0.362]   No USB host detected
[   0.362] Loading kernel image info
Loading kernel (1961 kB)... done in 565 ms (3469 kB/s)
[   0.919] Loading initfs image info
[   0.920] Total bootup time 1591 ms
[   0.922] Serial console enabled


U-Boot 2013.04 (Apr 20 2013 - 11:00:56)

OMAP35XX-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 600 MHz
Nokia RX-51 + LPDDR/OneNAND
I2C:   ready
DRAM:  256 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment

In:    vga
Out:   vga
Err:   vga
SD: ACMD41 in a wrong state
SD: CMD1 in a wrong state
SD: ACMD41 in a wrong state
SD: CMD1 in a wrong state
SD: ACMD41 in a wrong state
SD: CMD1 in a wrong state
SD: ACMD41 in a wrong state
SD: CMD1 in a wrong state
Uncompressing Linux................................................................................................................... done, booting the kernel.
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
tsc2005_txrx_word: touchscreen sense disabled
tsc2005_write: touchscreen sense enabled
QEMU: Terminated
I didn't realize ^C wouldn't go into the guest image the qemu-linaro fork is a bit old it would seem.

Unfortunately, after all this, the resulting image does not boot up correctly; it just displays a "Twitter" tile on a black screen... and that's basically it. I can't interact with it at all. The only thing I can do is press F2, which turns the touch layer on and off - producing the messages toward the end of the above scrollback.

Interestingly, at one point, while I was tinkering around with Hildon in my vanilla Debian image, I actually got the exact same result - a lone Twitter tile on an otherwise-blank display, which didn't do anything when I clicked it. This suggests to me that, considering this failure happened while I was struggling with getting GL working, perhaps the N900 setup doesn't have working GL, and it's failing in exactly the same way?? If true, this would be consistent with "SGX not working". But I'm truly stumped.

(For archival, since IP addresses to tend to bitrot eventually, google finds references to an "ivo" connecting to IRC from that IP, along with a similar/consistent "From:" email at https://lkml.org/lkml/2016/1/7/490 (which also references the IP).)

If you got to the end of this without skipping through anything, then even if you have no suggestions, please leave a comment so I can properly congratulate/thank you! :P
 

The Following 3 Users Say Thank You to i336_ For This Useful Post: