All of lore.kernel.org
 help / color / mirror / Atom feed
From: BALATON Zoltan <balaton@eik.bme.hu>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Alexander Graf <agraf@suse.de>,
	David Gibson <david@gibson.dropbear.id.au>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] ppc: Fix sam460ex devicetree when booting the Linux kernel
Date: Fri, 22 Jun 2018 23:37:30 +0200 (CEST)	[thread overview]
Message-ID: <alpine.BSF.2.21.1806222322110.86811@zero.eik.bme.hu> (raw)
In-Reply-To: <c59b2d3e-384a-f3d9-41a7-74439cd3c78e@roeck-us.net>

On Fri, 22 Jun 2018, Guenter Roeck wrote:
> On 06/22/2018 12:52 AM, BALATON Zoltan wrote:
>> On Fri, 22 Jun 2018, David Gibson wrote:
>>> On Thu, Jun 21, 2018 at 09:47:51PM -0700, Guenter Roeck wrote:
>>>> sam4660ex (or at least this emulation) does not support the "ibm,cpm" 
>>>> power
>>>> management. As a result, Linux crashes when trying to access it. Remove
>>>> its devicetree node. Also, if/when we boot the Linux kernel directly,
>>>> u-boot will not fix up serial frequencies in the devicetree file, and
>>>> serial port initialization will fail. Add plausible frequency values to 
>>>> the
>>>> first serial port to be able to use it. Disable the second serial port
>>>> since it is not available on the board.? Also set valid values for the
>>>> other clock nodes otherwise set by u-boot.
>> 
>> Patching clock values when using -kernel instead of u-boot looks good. 
>> Although I've tested booting a Linux kernel and could see serial output 
>> while the kernel boots, it only went silent after started user space. Is 
>> this the same you see or you don't get serial output (with loglevel set to 
>> some higher value) even during kernel boot? Which kernel and image do you 
>> test with?
>> 
> I test with all stable kernel releases starting with 3.16.
>
> Correct, this is exactly what I was seeing as well. I also noticed that the
> system keeps running, only there is no serial output.
>
>> Does leaving second UART in device tree cause any problems? The fdt in 
>> kernel has these and I'm not sure u-boot would patch this out. Do we need 
>> to remove this? This did not seem to cause any problem with guests I've 
>> tried so far. Does real hardware have a different fdt than the stock kernel 
>> one (which is also what's downloadable from ACube's site).
>> 
> Only that the port fails to initialize without clock. We could leave it 
> in the tree, but it would only have value if the clocks are actually 
> set, and then it would be a qemu-only value (presumably; I read 
> somewhere that the board only has a single serial port). I don't have a 
> strong opinion either way. Also, I don't know what u-boot does.

I think you probably read the comment in qemu/hw/ppc/sam460ex.c:526 which 
mentions hardware should have 4 serial ports but board has only one and 
two are in device tree therefore only these two are emulated. Not sure 
what's the right way here so unless this causes any problems I'd leave it 
as it is now and not patch the device tree for this because that would 
make it different from what you get when using u-boot so unless u-boot 
also removes this node I think -kernel should behave the same and leave 
it there.

>> The version of the Linux kernel I've tried (which is from the Linux CD on 
>> ACube's site) did not try to access the power management register, neither 
>> any guest OSes I've tested with. Looks like it may be specific to the 
>> kernel config you're using.
>> 
> Interesting. This is with the standard upstream kernel, using 
> canyonlands_defconfig.
> The code seems to have been in the upstream kernel forever.

Maybe the Sam460ex specific image has some patches not in upstream kernel.

>> By the way, when I've tried with a more recent Linux kernel (4.15.10) I've 
>> noticed that the sm501 driver seemed like having endianness problems and 
>> thus did not find the chip, while it works with other older kernels made 
>> for sam460ex. I did not try to debug or bisect this yet. Do you know 
>> anything about that?
>> 
>
> No, I had not noticed. SM501 is disabled in the latest canyonlands_defconfig,
> and I only use the serial console for my testing. It fails as far back as 
> 3.18.y,
> so I am not sure if this is a Linux or a qemu problem, or if it is a problem 
> that
> was never fixed in the upstream kernel. What kernels did you try ?

I've tried the kernel from this iso:

http://www.acube-systems.biz/index.php?page=news&id=106

(the image does not boot with u-boot because it seems to hit a bug in the 
firmware so could only test it with directly booting kernel with -kernel 
option).

I've also tried a stock upstream 4.15.10 kernel which is where I've seen 
it reading the PCI IDs of the SM501 endian swapped and failed to find 
device because of that. There are also several other kernels and images 
here:

http://www.supertuxkart-amiga.de/amiga/sam.html#downloads

That I haven't tried. The images start to boot but I could not get to boot 
one fully.

Regards,
BALATON Zoltan

  reply	other threads:[~2018-06-22 21:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-22  4:47 [Qemu-devel] [PATCH] ppc: Fix sam460ex devicetree when booting the Linux kernel Guenter Roeck
2018-06-22  5:03 ` David Gibson
2018-06-22  7:52   ` BALATON Zoltan
2018-06-22 13:34     ` Guenter Roeck
2018-06-22 21:37       ` BALATON Zoltan [this message]
2018-06-23  2:34         ` Guenter Roeck
2018-06-23 20:55           ` BALATON Zoltan
2018-06-23 21:15             ` Guenter Roeck
2018-06-23 21:32               ` BALATON Zoltan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.BSF.2.21.1806222322110.86811@zero.eik.bme.hu \
    --to=balaton@eik.bme.hu \
    --cc=agraf@suse.de \
    --cc=david@gibson.dropbear.id.au \
    --cc=linux@roeck-us.net \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.