All of lore.kernel.org
 help / color / mirror / Atom feed
* Linux 4.7 and Jornada 720 (SA-1100)
@ 2016-08-18 14:05 Adam Wysocki
  2016-08-19 10:29 ` Russell King - ARM Linux
  0 siblings, 1 reply; 8+ messages in thread
From: Adam Wysocki @ 2016-08-18 14:05 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

I don't know if this is a proper group, but maybe someone will help?

I have a problem running Linux 4.7 on Jornada 720 handheld PC. This 
antique has a StrongARM SA-1100 CPU (ARMv4-based) and Windows CE 3.0 
stored in ROM. There is also an utility called jlinexec.exe (from 
JLime project which is now nearly-dead) that is able to boot Linux 
kernel on this machine.

There is another, older kernel (from this JLime project) that already runs 
there:

gof at jornada7xx:~$ uname -a
Linux jornada7xx 2.6.25-jlime #1 Wed Jul 16 15:52:07 CEST 2008 armv4l unknown 

CPU is:

gof at jornada7xx:~$ cat /proc/cpuinfo
Processor       : StrongARM-1110 rev 8 (v4l)
BogoMIPS        : 137.21
Features        : swp half 26bit fastmult
CPU implementer : 0x69
CPU architecture: 4
CPU variant     : 0x0
CPU part        : 0xb11
CPU revision    : 8

Hardware        : HP Jornada 720
Revision        : 0000
Serial  : 0000000000000000 

I wanted to compile new, fresh 4.7 with BX emulation patch applied:

https://git.kernel.org/cgit/linux/kernel/git/maz/arm-platforms.git/commit/?h=arm/netwinder&id=6d833b52d0591b47ee65ef2808c459a99f1d37ec

so I could run Debian userland compiled for "armel" architecture there 
(these binaries don't use Thumb state, which this CPU lacks, but use BX 
instruction, so they immediately fail with SIGILL). I did my compilation 
with arm-linux-gnueabi cross-compiler and it compiled cleanly.

However, when I try to run the kernel, the machine hangs. Only one 
horizontal line is visible on the LCD (probably because CPU, normally 
responsible for LCD refreshing, stops doing that) and that's all.

I connected terminal to a serial port and tried playing with earlyprintk= 
and console= settings (earlyprintk=serial,ttyS0,115200), but without luck. 
The only thing I get on the serial port is the jlinexec.exe "logo":

--------linexec--------

I'm not even sure if early printk is available on this architecture...

Kernel command line contains only ram=32 now and there's no initial 
ramdisk (when I get to the point of booting it, I'll add root= and try to 
mount rootfs).

I also tried booting kernel ELF image with hpcboot.exe (a bootloader from 
Jornada NetBSD port), but it failed to boot, too. Well, it's not supposed 
to boot Linux anyway...

Here's my first thread on debian-arm list:

https://groups.google.com/forum/#!topic/linux.debian.ports.arm/lbvmPvA6_2k

But as it became a kernel problem now, I think it's more appropriate to 
ask here.

My kernel .config is here: http://pastebin.com/QSsJybS8

Anyone able to help troubleshoot that?

Thank you!

-- 
http://www.chmurka.net/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Linux 4.7 and Jornada 720 (SA-1100)
  2016-08-18 14:05 Linux 4.7 and Jornada 720 (SA-1100) Adam Wysocki
@ 2016-08-19 10:29 ` Russell King - ARM Linux
  2016-08-19 13:11   ` Adam Wysocki
  0 siblings, 1 reply; 8+ messages in thread
From: Russell King - ARM Linux @ 2016-08-19 10:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 18, 2016 at 02:05:26PM +0000, Adam Wysocki wrote:
> I don't know if this is a proper group, but maybe someone will help?
> 
> I have a problem running Linux 4.7 on Jornada 720 handheld PC. This 
> antique has a StrongARM SA-1100 CPU (ARMv4-based) and Windows CE 3.0 
> stored in ROM. There is also an utility called jlinexec.exe (from 
> JLime project which is now nearly-dead) that is able to boot Linux 
> kernel on this machine.

I don't have any SA1100 devices, I only have a couple of SA1110 Assabets.
I've just tested 4.8.0-rc2 there, and it boots, although cpufreq appears
a little unhappy.

Make sure you have "console=ttySA0,38400n8" or similar to get serial
console output - it needs to be a "ttySA" port, not "ttyS".

Same probably goes for "earlyprintk=serial,ttyS0,115200", although I've
no experience of earlyprintk myself.  However, if you're not even
getting the "Uncompressing Linux... done, booting the kernel." line,
that suggests the decompressor is not running, or is trying to access
the wrong serial port.  The decompressor tries to find the first serial
port out of serial 3, 1 and 2 which has been left enabled.

Hope this helps.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Linux 4.7 and Jornada 720 (SA-1100)
  2016-08-19 10:29 ` Russell King - ARM Linux
@ 2016-08-19 13:11   ` Adam Wysocki
  2016-08-19 13:26     ` Russell King - ARM Linux
  0 siblings, 1 reply; 8+ messages in thread
From: Adam Wysocki @ 2016-08-19 13:11 UTC (permalink / raw)
  To: linux-arm-kernel

Russell King - ARM Linux <linux@armlinux.org.uk> wrote:

> Make sure you have "console=ttySA0,38400n8" or similar to get serial
> console output - it needs to be a "ttySA" port, not "ttyS".

Hmm... I changed to:

root=0x302 mem=32m console=ttySA0,115200n8

and success - it helped! The screen is still blank, but I least I have 
some messages on the serial port, finished with kernel panic because of 
failing to mount root. It looks like I didn't enable some drivers for 
the CF controller, but I look and it seems everything that should be 
enabled is enabled... maybe this kernel doesn't support CF on Jornada 
without a patch?

http://pastebin.com/J2ATKxQM

And I'm just wondering why the screen is blank while I definitely enabled 
the SA-1100 framebuffer support and console on framebuffer... I'm not sure 
if it should be blank when I specified console=ttySA0, but I don't think 
it should be blank without any console= setting...

> Same probably goes for "earlyprintk=serial,ttyS0,115200", although I've
> no experience of earlyprintk myself.

It seems that earlyprintk is ignored anyway, maybe there's no support for 
it on this platform?

> However, if you're not even getting the "Uncompressing Linux... done, 
> booting the kernel." line, that suggests the decompressor is not running, 
> or is trying to access the wrong serial port.  The decompressor tries to 
> find the first serial port out of serial 3, 1 and 2 which has been left 
> enabled.

In this order? Maybe it tries to send its messages to the built-in modem 
or IrDA port...

Anyway, now I know that kernel boots, so it's definitely helpful. I'll try 
to find out what's wrong with this console and CF controller...

-- 
http://www.chmurka.net/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Linux 4.7 and Jornada 720 (SA-1100)
  2016-08-19 13:11   ` Adam Wysocki
@ 2016-08-19 13:26     ` Russell King - ARM Linux
  2016-08-19 14:33       ` Adam Wysocki
  0 siblings, 1 reply; 8+ messages in thread
From: Russell King - ARM Linux @ 2016-08-19 13:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 19, 2016 at 01:11:13PM +0000, Adam Wysocki wrote:
> Russell King - ARM Linux <linux@armlinux.org.uk> wrote:
> 
> > Make sure you have "console=ttySA0,38400n8" or similar to get serial
> > console output - it needs to be a "ttySA" port, not "ttyS".
> 
> Hmm... I changed to:
> 
> root=0x302 mem=32m console=ttySA0,115200n8
> 
> and success - it helped! The screen is still blank, but I least I have 
> some messages on the serial port, finished with kernel panic because of 
> failing to mount root. It looks like I didn't enable some drivers for 
> the CF controller, but I look and it seems everything that should be 
> enabled is enabled... maybe this kernel doesn't support CF on Jornada 
> without a patch?
> 
> http://pastebin.com/J2ATKxQM
> 
> And I'm just wondering why the screen is blank while I definitely enabled 
> the SA-1100 framebuffer support and console on framebuffer... I'm not sure 
> if it should be blank when I specified console=ttySA0, but I don't think 
> it should be blank without any console= setting...

Looking at the board file, the jornada720 doesn't use sa11x0-fb at all.
It uses an Epson s1d13xxx device.  The defconfig for jornada720 has:

CONFIG_FB_S1D13XXX=y

so if your configuration is derived from that, you should have the
driver already enabled.

> > Same probably goes for "earlyprintk=serial,ttyS0,115200", although I've
> > no experience of earlyprintk myself.
> 
> It seems that earlyprintk is ignored anyway, maybe there's no support for 
> it on this platform?

No idea, sorry.  I use my printascii() hack in printk() when I need early
or lowlevel debugging rather than early printk.

> > However, if you're not even getting the "Uncompressing Linux... done, 
> > booting the kernel." line, that suggests the decompressor is not running, 
> > or is trying to access the wrong serial port.  The decompressor tries to 
> > find the first serial port out of serial 3, 1 and 2 which has been left 
> > enabled.
> 
> In this order? Maybe it tries to send its messages to the built-in modem 
> or IrDA port...

Yes, that order.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Linux 4.7 and Jornada 720 (SA-1100)
  2016-08-19 13:26     ` Russell King - ARM Linux
@ 2016-08-19 14:33       ` Adam Wysocki
  2016-08-19 15:18         ` Russell King - ARM Linux
  0 siblings, 1 reply; 8+ messages in thread
From: Adam Wysocki @ 2016-08-19 14:33 UTC (permalink / raw)
  To: linux-arm-kernel

Russell King - ARM Linux <linux@armlinux.org.uk> wrote:

> Looking at the board file, the jornada720 doesn't use sa11x0-fb at all.
> It uses an Epson s1d13xxx device.  The defconfig for jornada720 has:

Another bingo - enabling this:

> CONFIG_FB_S1D13XXX=y

Solved the issue with console. Thanks!

> so if your configuration is derived from that, you should have the
> driver already enabled.

Where is this board file and defconfig for Jornada? I wasn't aware of 
their existence, so I did my config from scratch. Maybe comparing my 
config to defconfig will solve the issue with CF card, too...

>> It seems that earlyprintk is ignored anyway, maybe there's no support for 
>> it on this platform?
> 
> No idea, sorry.

Well, now, as I have the console, it's not needed anymore :)

> I use my printascii() hack in printk() when I need early or lowlevel 
> debugging rather than early printk.

Where does it print to? Serial port?

>> > However, if you're not even getting the "Uncompressing Linux... done, 
>> > booting the kernel." line, that suggests the decompressor is not running, 
>> > or is trying to access the wrong serial port.  The decompressor tries to 
>> > find the first serial port out of serial 3, 1 and 2 which has been left 
>> > enabled.
>> 
>> In this order? Maybe it tries to send its messages to the built-in modem 
>> or IrDA port...
> 
> Yes, that order.

>From SA-1100 developers manual it seems that:

- serial 0 is the USB device controller
- serial 1 is the SDLC/UART
- serial 2 is the IrDA port
- serial 3 is the UART (probably this one is routed externally)
- serial 4 is the MCP / SSP (whatever it is)

So it should use UART... strange that it doesn't do it. Or maybe it does, 
but on different baudrate than 115200 (but I would probably get garbage 
then)...

Does it mean that if I enabled USB device and IrDA in the kernel, I would 
have external serial port on ttySA2 instead of 0?

Thanks again for your support.

-- 
http://www.chmurka.net/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Linux 4.7 and Jornada 720 (SA-1100)
  2016-08-19 14:33       ` Adam Wysocki
@ 2016-08-19 15:18         ` Russell King - ARM Linux
  2016-08-24 13:34           ` Adam Wysocki
  0 siblings, 1 reply; 8+ messages in thread
From: Russell King - ARM Linux @ 2016-08-19 15:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 19, 2016 at 02:33:34PM +0000, Adam Wysocki wrote:
> Russell King - ARM Linux <linux@armlinux.org.uk> wrote:
> 
> > Looking at the board file, the jornada720 doesn't use sa11x0-fb at all.
> > It uses an Epson s1d13xxx device.  The defconfig for jornada720 has:
> 
> Another bingo - enabling this:
> 
> > CONFIG_FB_S1D13XXX=y
> 
> Solved the issue with console. Thanks!
> 
> > so if your configuration is derived from that, you should have the
> > driver already enabled.
> 
> Where is this board file and defconfig for Jornada? I wasn't aware of 
> their existence, so I did my config from scratch. Maybe comparing my 
> config to defconfig will solve the issue with CF card, too...

The cut-down configuration file is in arch/arm/configs/jornada720_defconfig,
but that's no use to compare against.  I'd suggest saving your existing
configuration file, switching to jornada720_defconfig, and then diffing
the result.  So, something like:

$ cp .config config-mine
$ make ARCH=arm jornada720_defconfig
$ diff -u .config config-mine | less

As jornada720_defconfig is rather old, I don't guarantee that it will
produce a working configuration file with current kernels as things
have changed over the years, but it should get you close.

> > I use my printascii() hack in printk() when I need early or lowlevel 
> > debugging rather than early printk.
> 
> Where does it print to? Serial port?

Yes.

> >> > However, if you're not even getting the "Uncompressing Linux... done, 
> >> > booting the kernel." line, that suggests the decompressor is not running, 
> >> > or is trying to access the wrong serial port.  The decompressor tries to 
> >> > find the first serial port out of serial 3, 1 and 2 which has been left 
> >> > enabled.
> >> 
> >> In this order? Maybe it tries to send its messages to the built-in modem 
> >> or IrDA port...
> > 
> > Yes, that order.
> 
> >From SA-1100 developers manual it seems that:
> 
> - serial 0 is the USB device controller
> - serial 1 is the SDLC/UART
> - serial 2 is the IrDA port
> - serial 3 is the UART (probably this one is routed externally)
> - serial 4 is the MCP / SSP (whatever it is)
> 
> So it should use UART... strange that it doesn't do it. Or maybe it does, 
> but on different baudrate than 115200 (but I would probably get garbage 
> then)...

All it does is look for the first enabled serial port, and write the
characters to the FIFO.  The idea is that the boot loader will have
setup one of the ports at the correct baud rate, and we don't need to
have device-specific hacks to select the correct port.

> Does it mean that if I enabled USB device and IrDA in the kernel, I would 
> have external serial port on ttySA2 instead of 0?

The whole ttySA to physical port is something of a mess - in the early
days, people insisted on having ttySA0 be the serial port wired up for
the console, with the other ttySA* devices assigned randomly to the
other UART ports (that's 1, 2, and 3, but not 0 and 4.)

Consequently, without digging through the code each time, there's no
easy way to determine the mapping of these ports.  In the case of
jornada720, arch/arm/mach-sa1100/jornada720.c defines these as:

        sa1100_register_uart(0, 3);
        sa1100_register_uart(1, 1);

which means ttySA0 -> serial 3, ttySA1 -> serial 1, ttySA2 is disabled.

Other platforms have the console on serial 1 rather than serial 3.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Linux 4.7 and Jornada 720 (SA-1100)
  2016-08-19 15:18         ` Russell King - ARM Linux
@ 2016-08-24 13:34           ` Adam Wysocki
  2016-08-24 14:52             ` Adam Wysocki
  0 siblings, 1 reply; 8+ messages in thread
From: Adam Wysocki @ 2016-08-24 13:34 UTC (permalink / raw)
  To: linux-arm-kernel

Russell King - ARM Linux <linux@armlinux.org.uk> wrote:

> $ cp .config config-mine
> $ make ARCH=arm jornada720_defconfig
> $ diff -u .config config-mine | less
> 
> As jornada720_defconfig is rather old, I don't guarantee that it will
> produce a working configuration file with current kernels as things
> have changed over the years, but it should get you close.

Thanks, I just used that. My .config is similar to the generated when it 
comes to the block layer and block devices, but it still fails to see any 
partitions...

Here's the diff: http://pastebin.com/raw/Mq8jPET9
Here's the console output: http://pastebin.com/raw/JkDvVV9A

Maybe some patches for the ide-gd driver are needed to support the CF 
card? Or even a different driver?

>> So it should use UART... strange that it doesn't do it. Or maybe it does, 
>> but on different baudrate than 115200 (but I would probably get garbage 
>> then)...
> 
> All it does is look for the first enabled serial port, and write the
> characters to the FIFO.  The idea is that the boot loader will have
> setup one of the ports at the correct baud rate, and we don't need to
> have device-specific hacks to select the correct port.

Hmm, maybe jlinexec.exe disables the serial port before passing control to 
the unpacker. Who knows.

> Consequently, without digging through the code each time, there's no
> easy way to determine the mapping of these ports.  In the case of
> jornada720, arch/arm/mach-sa1100/jornada720.c defines these as:
> 
>         sa1100_register_uart(0, 3);
>         sa1100_register_uart(1, 1);
> 
> which means ttySA0 -> serial 3, ttySA1 -> serial 1, ttySA2 is disabled.

I see. Thanks for explanation!

If you have some patches (mentioned in another email), I'm ready for 
testing.

-- 
http://www.chmurka.net/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Linux 4.7 and Jornada 720 (SA-1100)
  2016-08-24 13:34           ` Adam Wysocki
@ 2016-08-24 14:52             ` Adam Wysocki
  0 siblings, 0 replies; 8+ messages in thread
From: Adam Wysocki @ 2016-08-24 14:52 UTC (permalink / raw)
  To: linux-arm-kernel

Adam Wysocki <gmane@chmurka.net> wrote:

> Here's the diff: http://pastebin.com/raw/Mq8jPET9
> Here's the console output: http://pastebin.com/raw/JkDvVV9A
> 
> Maybe some patches for the ide-gd driver are needed to support the CF 
> card? Or even a different driver?

I made some more investigation.

In the old kernel (2.6.25) ide_disk.c driver is used ("ide-disk version 
1.18"). Here's the boot console output: http://pastebin.com/raw/YqZBGHp9

We can see there:

Uniform Multi-Platform E-IDE driver
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
[...]
Probing IDE interface ide0...
hda: SanDisk SDCFH-008G, CFA DISK drive

So it's okay.

In the new kernel, only ide_gd.c identifies itself:

Uniform Multi-Platform E-IDE driver
ide-gd driver 1.18

I made some diagnostic printks in ide_gd_probe(), ide_disk_check() and 
ide_disk_setup(): http://pastebin.com/raw/AeE4KD2H

But they are never printed. It seems something was broken in this driver 
between 2.6.25 and 4.7...

Maybe instead of trying to get the old and deprecated code ("IDE") to 
work, it would be better to make the new code ("ATA" or libata) work?

-- 
http://www.chmurka.net/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-08-24 14:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-18 14:05 Linux 4.7 and Jornada 720 (SA-1100) Adam Wysocki
2016-08-19 10:29 ` Russell King - ARM Linux
2016-08-19 13:11   ` Adam Wysocki
2016-08-19 13:26     ` Russell King - ARM Linux
2016-08-19 14:33       ` Adam Wysocki
2016-08-19 15:18         ` Russell King - ARM Linux
2016-08-24 13:34           ` Adam Wysocki
2016-08-24 14:52             ` Adam Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.