Kernel 4.8

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

Re: Kernel 4.8

Post by xeno74 »

Hi All

I compiled the alpha3 without removing the powerpc modifications today. Unfortunately the problem with i2c and Xorg still exists. So I have to remove the powerpc-4.8-1 and i2c commit. But unfortunately I wasn't able to remove the powerpc-4.8-1 commit because of dependencies to another new commits.

I tried to revert some new commits to solve the dependencies to the powerpc-4.8-1 but unfortunately without any success. That means it isn't possible to compile the kernel 4.8. We have to find the problematic code.

Sorry

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

Running Linux on AmigaONEs can require some tinkering.

User avatar
xeno74
Posts: 5581
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.8

Post by xeno74 »

It seems there is another problem after the first powerpc merge:

Code: Select all

[   15.086650] pasemi_mac e900:00:14.3 enP59648p0s20f3: renamed from eth0
[   18.528456] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   18.528634] 8139too e900:06:05.0 eth1: link up, 100Mbps, full-duplex, lpa 0x45E1
[   18.624162] IPv6: ADDRCONF(NETDEV_UP): enP59648p0s20f3: link is not ready
[   18.626282] enP59648p0s20f3: Could not attach to phy
[   18.646488] pasemi_mac e900:00:14.3: PHY init failed: -19.
[   18.646492] pasemi_mac e900:00:14.3: Defaulting to 1Gbit full duplex
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

User avatar
xeno74
Posts: 5581
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.8

Post by xeno74 »

Hi All,

I figured out that the kernel 4.8 successfully detected my Radeon HD6870 but Xorg can't access it.

The reason is, that the BusID has changed between the kernel 4.7 and 4.8.

Kernel 4.7:

Code: Select all

01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Barts XT [Radeon HD 6870]
xorg.conf:

Code: Select all

Section "Device"
BusID       "PCI:1:0:0"
Kernel 4.8:

Code: Select all

e900:01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Barts XT [Radeon HD 6870]
How does the new BusID look like in the xorg.conf?

Xorg needs the BusID in the xorg.conf. Without the BusID, Xorg doesn't start.

Cheers,

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

Running Linux on AmigaONEs can require some tinkering.

User avatar
xeno74
Posts: 5581
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.8

Post by xeno74 »

dmesg | grep -i radeon

Code: Select all

[    0.997471] [drm] radeon kernel modesetting enabled.
[    1.171136] radeon e900:01:00.0: VRAM: 1024M 0x0000000000000000 - 0x000000003FFFFFFF (1024M used)
[    1.171141] radeon e900:01:00.0: GTT: 1024M 0x0000000040000000 - 0x000000007FFFFFFF
[    1.171270] [drm] radeon: 1024M of VRAM memory ready
[    1.171273] [drm] radeon: 1024M of GTT memory ready.
[    1.176557] [drm] radeon: dpm initialized
[    1.212690] radeon e900:01:00.0: WB enabled
[    1.212697] radeon e900:01:00.0: fence driver on ring 0 use gpu addr 0x0000000040000c00 and cpu addr 0xc00000026dbdbc00
[    1.212702] radeon e900:01:00.0: fence driver on ring 3 use gpu addr 0x0000000040000c0c and cpu addr 0xc00000026dbdbc0c
[    1.219475] radeon e900:01:00.0: fence driver on ring 5 use gpu addr 0x0000000000072118 and cpu addr 0xd0000800901b2118
[    1.219485] radeon e900:01:00.0: radeon: MSI limited to 32-bit
[    1.219530] [drm] radeon: irq initialized.
[    2.070343] [drm] Radeon Display Connectors
[    2.917509] radeon e900:01:00.0: fb0: radeondrmfb frame buffer device
[    2.923810] [drm] Initialized radeon 2.46.0 20080528 for e900:01:00.0 on minor 0
dmesg | grep -i e900:01:00.0

Code: Select all

[    0.152680] pci e900:01:00.0: [1002:6738] type 00 class 0x030000
[    0.152694] pci e900:01:00.0: calling .pci_dev_pdn_setup+0x0/0x3c
[    0.152710] pci e900:01:00.0: reg 0x10: [mem 0x90000000-0x9fffffff 64bit pref]
[    0.152722] pci e900:01:00.0: reg 0x18: [mem 0xa0020000-0xa003ffff 64bit]
[    0.152731] pci e900:01:00.0: reg 0x20: [io  0x2000-0x20ff]
[    0.152744] pci e900:01:00.0: reg 0x30: [mem 0xa0000000-0xa001ffff pref]
[    0.152755] pci e900:01:00.0: calling .pcibios_fixup_resources+0x0/0x110
[    0.152763] pci e900:01:00.0: calling .quirk_no_pm_reset+0x0/0x40
[    0.152804] pci e900:01:00.0: supports D1 D2
[    0.494871] pci e900:01:00.0: calling .fixup_vga+0x0/0x3c
[    1.171136] radeon e900:01:00.0: VRAM: 1024M 0x0000000000000000 - 0x000000003FFFFFFF (1024M used)
[    1.171141] radeon e900:01:00.0: GTT: 1024M 0x0000000040000000 - 0x000000007FFFFFFF
[    1.212690] radeon e900:01:00.0: WB enabled
[    1.212697] radeon e900:01:00.0: fence driver on ring 0 use gpu addr 0x0000000040000c00 and cpu addr 0xc00000026dbdbc00
[    1.212702] radeon e900:01:00.0: fence driver on ring 3 use gpu addr 0x0000000040000c0c and cpu addr 0xc00000026dbdbc0c
[    1.219475] radeon e900:01:00.0: fence driver on ring 5 use gpu addr 0x0000000000072118 and cpu addr 0xd0000800901b2118
[    1.219485] radeon e900:01:00.0: radeon: MSI limited to 32-bit
[    2.917509] radeon e900:01:00.0: fb0: radeondrmfb frame buffer device
[    2.923810] [drm] Initialized radeon 2.46.0 20080528 for e900:01:00.0 on minor 0
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

User avatar
xeno74
Posts: 5581
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.8

Post by xeno74 »

FBDEV with the kernel 4.8:

Code: Select all

Fatal server error:
xf86MapLegacyIO(): domain out of range
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

User avatar
xeno74
Posts: 5581
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.8

Post by xeno74 »

Maybe good news?
Michael Ellerman wrote: This should fix it?

https://patchwork.ozlabs.org/patch/656042/

mpe breaks pasemi again :{

cheers

Code: Select all

The recent commit 63a72284b159 ("powerpc/pci: Assign fixed PHB number
based on device-tree properties"), added code to read a 64-bit property
from the device tree, and if not found read a 32-bit property (reg).

There was a bug in the 32-bit case, on big endian machines, due to the
use of the 64-bit value to read the 32-bit property. The cast of &prop
means we end up writing to the high 32-bit of prop, leaving the low
32-bits containing whatever junk was on the stack.

If that junk value was non-zero, and < MAX_PHBS, we would end up using
it as the PHB id.

This exposed a second problem, which is that Xorg can't cope with a
domain number > 256.

So for now drop the fallback to reg, and only use "ibm,opal-phbid" for
PHB numbering.

Fixes: 63a72284b159 ("powerpc/pci: Assign fixed PHB number based on device-tree properties")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/pci-common.c | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)


This is my bad. Guilherme limited the reg case to pseries only, but I made it
generic. I tested it on G5, Cell etc. which all booted - but that's not really
a good enough test.

diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index f93942b4b6a6..f9c2ffaa1884 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -77,29 +77,23 @@ EXPORT_SYMBOL(get_pci_dma_ops);
  */
 static int get_phb_number(struct device_node *dn)
 {
-	int ret, phb_id = -1;
+	int ret, phb_id;
 	u64 prop;
 
 	/*
-	 * Try fixed PHB numbering first, by checking archs and reading
-	 * the respective device-tree properties. Firstly, try powernv by
-	 * reading "ibm,opal-phbid", only present in OPAL environment.
+	 * On powernv machines we should have the "ibm,opal-phbid" property, if
+	 * so use that so that PHB numbers are predictable.
 	 */
 	ret = of_property_read_u64(dn, "ibm,opal-phbid", &prop);
-	if (ret)
-		ret = of_property_read_u32_index(dn, "reg", 1, (u32 *)&prop);
-
-	if (!ret)
+	if (ret == 0) {
 		phb_id = (int)(prop & (MAX_PHBS - 1));
 
-	/* We need to be sure to not use the same PHB number twice. */
-	if ((phb_id >= 0) && !test_and_set_bit(phb_id, phb_bitmap))
-		return phb_id;
+		/* Make sure never to use the same PHB number twice. */
+		if (!test_and_set_bit(phb_id, phb_bitmap))
+			return phb_id;
+	}
 
-	/*
-	 * If not pseries nor powernv, or if fixed PHB numbering tried to add
-	 * the same PHB number twice, then fallback to dynamic PHB numbering.
-	 */
+	/* If fixed PHB numbering failed, fallback to dynamic PHB numbering. */
 	phb_id = find_first_zero_bit(phb_bitmap, MAX_PHBS);
 	BUG_ON(phb_id >= MAX_PHBS);
 	set_bit(phb_id, phb_bitmap);
-- 
2.7.4
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

User avatar
xeno74
Posts: 5581
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.8

Post by xeno74 »

New Nemo patch for the alpha3: nemo_4.8-3.patch
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

User avatar
xeno74
Posts: 5581
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.8

Post by xeno74 »

Keep your fingers crossed!
  1. Code: Select all

    git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a
  2. patch -p0 < nemo_4.8-3.patch
  3. Code: Select all

    yes "" | make oldconfig
  4. I activated the following new BTRFS options for Srtest:
    CONFIG_BTRFS_FS_POSIX_ACL=y
    CONFIG_BTRFS_FS_CHECK_INTEGRITY=y
    CONFIG_BTRFS_FS_RUN_SANITY_TESTS=y
    # CONFIG_BTRFS_DEBUG is not set
    CONFIG_BTRFS_ASSERT=y
  5. make vmlinux
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

User avatar
xeno74
Posts: 5581
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.8

Post by xeno74 »

xeno74 wrote:Keep your fingers crossed!
  1. Code: Select all

    git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a
  2. patch -p0 < nemo_4.8-3.patch
  3. Code: Select all

    yes "" | make oldconfig
  4. I activated the following new BTRFS options for Srtest:
    CONFIG_BTRFS_FS_POSIX_ACL=y
    CONFIG_BTRFS_FS_CHECK_INTEGRITY=y
    CONFIG_BTRFS_FS_RUN_SANITY_TESTS=y
    # CONFIG_BTRFS_DEBUG is not set
    CONFIG_BTRFS_ASSERT=y
  5. make vmlinux
Xorg works!!!!!!!!!!!!!!!!!!!!!!! :-)

Next step: make modules :-)
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

User avatar
xeno74
Posts: 5581
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.8

Post by xeno74 »

The internal CompactFlash (CF) card device doesn't work anymore. That means the code for the internal CF card device in the Nemo patch doesn't work after the first PowerPC merge. The CompactFlash (CF) card slot is wired to the CPU local bus. It is typically used to hold the Linux kernel.

We use the following patch:

Code: Select all

diff -rupN a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
--- a/drivers/ata/pata_of_platform.c	2016-08-05 09:58:41.410569036 +0200
+++ b/drivers/ata/pata_of_platform.c	2016-08-05 09:59:54.414288884 +0200
@@ -41,14 +41,36 @@ static int pata_of_platform_probe(struct
 		return -EINVAL;
 	}
 
-	ret = of_address_to_resource(dn, 1, &ctl_res);
-	if (ret) {
-		dev_err(&ofdev->dev, "can't get CTL address from "
-			"device tree\n");
-		return -EINVAL;
+	if (of_device_is_compatible(dn, "electra-ide")) {
+		/* Altstatus is really at offset 0x3f6 from the primary window
+		 * on electra-ide. Adjust ctl_res and io_res accordingly.
+		 */
+		ctl_res = io_res;
+		ctl_res.start = ctl_res.start+0x3f6;
+		io_res.end = ctl_res.start-1;
+
+#ifdef CONFIG_PPC_PASEMI_SB600
+       } else if (of_device_is_compatible(dn, "electra-cf")) {
+               /* Task regs are at 0x800, with alt status @ 0x80e in the primary window
+                * on electra-cf. Adjust ctl_res and io_res accordingly.
+                */
+               ctl_res = io_res;
+               io_res.start += 0x800;
+               ctl_res.start = ctl_res.start + 0x80e;
+               io_res.end = ctl_res.start-1;
+#endif
+	} else {
+		ret = of_address_to_resource(dn, 1, &ctl_res);
+		if (ret) {
+			dev_err(&ofdev->dev, "can't get CTL address from "
+				"device tree\n");
+			return -EINVAL;
+		}
 	}
 
 	irq_res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0);
+	if (irq_res)
+		irq_res->flags = 0;
 
 	prop = of_get_property(dn, "reg-shift", NULL);
 	if (prop)
@@ -65,6 +87,11 @@ static int pata_of_platform_probe(struct
 		dev_info(&ofdev->dev, "pio-mode unspecified, assuming PIO0\n");
 	}
 
+#ifdef CONFIG_PPC_PASEMI_SB600
+       irq_res = 0;                    // force irq off (doesn't seem to work)
+#endif
+
+
 	pio_mask = 1 << pio_mode;
 	pio_mask |= (1 << pio_mode) - 1;
 
@@ -74,7 +101,11 @@ static int pata_of_platform_probe(struct
 
 static struct of_device_id pata_of_platform_match[] = {
 	{ .compatible = "ata-generic", },
-	{ },
+	{ .compatible = "electra-ide", },
+#ifdef CONFIG_PPC_PASEMI_SB600
+       { .compatible = "electra-cf",},
+#endif
+	{},
 };
 MODULE_DEVICE_TABLE(of, pata_of_platform_match);
dmesg with the kernel 4.7:

zcat /var/log/dmesg.1.gz | grep -i ata7

Code: Select all

[    2.939788] ata7: PATA max PIO0 no IRQ, using PIO polling mmio cmd 0xf0000800 ctl 0xf000080e
[    3.099186] ata7.00: CFA: SanDisk SDCFB-256, HDX 2.33, max PIO4
[    3.099191] ata7.00: 501760 sectors, multi 0: LBA 
[    3.099199] ata7.00: configured for PIO
The dmesg of the latest Git kernel doesn't have any output of our internal CF card device.
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

Post Reply