Darren's new Nemo patches for the official Linux kernel

AmigaOne X1000 platform specific issues related to Linux only.
User avatar
xeno74
Posts: 9322
Joined: Fri Mar 23, 2012 7:58 am

Re: Darren's new Nemo patches for the official Linux kernel

Post by xeno74 »

FYI:
Hi Michael,
Hi All,

kbuild test robot Wed, 03 Jan 2018 04:17:20 -0800 wrote:

Hi Darren,

Thank you for the patch! Perhaps something to improve:

arch/powerpc/platforms/pasemi/pci.c: In function 'sb600_set_flag': >> include/linux/kern_levels.h:5:18: warning: format '%lx' expects argument of >> type 'long unsigned int', but argument 2 has type 'resource_size_t {aka long >> long unsigned int}' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */

—-

I was able to fix this small format issue. I replaced the format '%08lx' with '%08llx'.

+ printk(KERN_CRIT "NEMO SB600 IOB base %08llx\n",res.start);

Is this fix OK or is there a better solution?

On 3. May 2018, at 15:06, Michael Ellerman <mpe@ellerman.id.au> wrote:

+
+ printk(KERN_CRIT "NEMO SB600 IOB base %08lx\n",res.start);

That's INFO or even DEBUG.


Michael,

What do you think about this fix?

+ printk(KERN_INFO "NEMO SB600 IOB base %08llx\n",res.start);

Thanks,
Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9322
Joined: Fri Mar 23, 2012 7:58 am

Re: Darren's new Nemo patches for the official Linux kernel

Post by xeno74 »

FYI
Michael wrote: pr_info() would be nice.

But I replied with lots of other comments previously.

None of them were super critical, but it would be nice to get them fixed
before merging if possible.

cheers
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9322
Joined: Fri Mar 23, 2012 7:58 am

Re: Darren's new Nemo patches for the official Linux kernel

Post by xeno74 »

FYI
Hello Michael,

Thanks a lot for your reply. OK, first I would like to add

pr_info("NEMO SB600 IOB base %08llx\n",res.start)

to the Nemo patch. Is this line correct now?

After that I will try to contact Darren because of your other comments.

If I don’t reach Darren then I will try to fix the issues but I think I need your help for fixing them.

Thanks,
Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9322
Joined: Fri Mar 23, 2012 7:58 am

Re: Darren's new Nemo patches for the official Linux kernel

Post by xeno74 »

FYI
Christian Zigotzky <chzigotzky@xenosoft.de> writes:

> Hello Michael,
>
> Thanks a lot for your reply. OK, first I would like to add
>
> pr_info("NEMO SB600 IOB base %08llx\n",res.start)
>
> to the Nemo patch. Is this line correct now?

Yes I think so.

The type of start is resource_size_t, which can be 32 or 64-bits. But in
this code it should always be 64-bit.

> After that I will try to contact Darren because of your other comments.
>
> If I don’t reach Darren then I will try to fix the issues but I think
> I need your help for fixing them.

Sure.

cheers

http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9322
Joined: Fri Mar 23, 2012 7:58 am

Re: Darren's new Nemo patches for the official Linux kernel

Post by xeno74 »

FYI:
Michael Ellerman wrote:
Darren Stevens wrote: Pasemi arch code finds the root of the PCI-e bus by searching the
device-tree for a node called 'pxp'. But the root bus has a
compatible property of 'pasemi,rootbus' so search for that instead.

Signed-off-by: Darren Stevens <darren at stevens-zone.net>
---

This works on the Amigaone X1000, I don't know if this method of
finding the pci bus was there bcause of earlier firmwares.
Does anyone have another pasemi board they can test this on?

The last time I plugged mine in it popped the power supply and took out
power to half the office :) - I haven't had a chance to try it since.

cheers

Code: Select all

diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
index c7c8607..be62380 100644
--- a/arch/powerpc/platforms/pasemi/pci.c
+++ b/arch/powerpc/platforms/pasemi/pci.c
@@ -216,6 +216,7 @@ static int __init pas_add_bridge(struct device_node *dev)
void __init pas_pci_init(void)
 {
    struct device_node *np, *root;
+   int res;
 
    root = of_find_node_by_path("/");
    if (!root) {
@@ -226,11 +227,11 @@ void __init pas_pci_init(void)
 
    pci_set_flags(PCI_SCAN_ALL_PCIE_DEVS);
 
-   for (np = NULL; (np = of_get_next_child(root, np)) != NULL;)
-       if (np->name && !strcmp(np->name, "pxp") && !pas_add_bridge(np))
-           of_node_get(np);
-
-   of_node_put(root);
+   np = of_find_compatible_node(root, NULL, "pasemi,rootbus");
+   if (np) {
+       res = pas_add_bridge(np);
+       of_node_put(np);
+   }
 }
 
 void __iomem *pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset)
Michael Ellerman wrote: I actually I remembered I have a device tree lying around from an electra.

It has:

home:pxp at 0,80000000(7)(I)> lsprop name compatible
name "pxp"
compatible "pasemi,rootbus"
"pa-pxp"


So it looks like the patch would work fine on it at least.

cheers


Link: [PATCH] powerpc/pasemi: Seach for PCI root bus by compatible property
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9322
Joined: Fri Mar 23, 2012 7:58 am

Re: Darren's new Nemo patches for the official Linux kernel

Post by xeno74 »

Michael Ellerman wrote: Christian Zigotzky <chzigotzky@xenosoft.de> writes:

> Just for info: I tested it on my Nemo board today and it works.

Awesome thanks.

That's probably sufficient to merge it, and if it breaks anything we can
always revert it.

cheers

http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9322
Joined: Fri Mar 23, 2012 7:58 am

Re: Darren's new Nemo patches for the official Linux kernel

Post by xeno74 »

FYI
Olof Johansson wrote:
Michael Ellerman wrote:
Christian Zigotzky wrote: Just for info: I tested it on my Nemo board today and it works.
Awesome thanks.

That's probably sufficient to merge it, and if it breaks anything we can always revert it.
Should be fine, all known boards have the properties in question, and
I doubt anyone has anything but Nemo and Electra/Chitra boards out
there.

It's a virtual root bus, so all boards have it irrespective of what
PCIe is brought out.

(I should hook up my test system and get it into the CI cycle again,
maybe this fall).


Acked-by: Olof Johansson <olof@lixom.net>


-Olof
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
Post Reply