All of lore.kernel.org
 help / color / mirror / Atom feed
From: ijc@hellion.org.uk (Ian Campbell)
To: linux-arm-kernel@lists.infradead.org
Subject: Automatically detecting when to use kirkwood-tsXXX-6281.dtb vs -6282.dtb (Was: Re: [PATCH 21/21] ARM: Kirkwood: Remove DT support)
Date: Sat, 03 May 2014 14:19:27 +0100	[thread overview]
Message-ID: <1399123167.23380.163.camel@dagon.hellion.org.uk> (raw)
In-Reply-To: <20140224162413.GE18601@lunn.ch>

On Mon, 2014-02-24 at 17:24 +0100, Andrew Lunn wrote:
> > > back in v3.2, lspci should still work.  Would that given you the
> > > information you need?
> > 
> > I expect it will, yes.
> 
> 3.14 with the new PCIe driver will also work. The patch was accepted
> and considered a regression so made it into one of the -rc's.

I've finally gotten around to doing something about detecting the
various different ts-xxx platforms in order to select between the 6281
and 6282 dtbs (reminder: I need to do this when running both old board
file kernels and new dtb based ones in order to support upgrades).

On TS-419 the PCI ID method works fine when running under 3.2 and 3.14
both using a board file. I'm currently building 3.15 with dts support so
I can test that too (and the soc subsystem export of the SoC ID which
was added in 3.15) but I'm relatively confident that'll all be OK.

However on my 6281 based TS-219 system there seems to be no visible PCI
bus when running the 3.2 kernel in the current Debian stable release
(which of course uses board support). Some info:
        $ grep ^Hardw /proc/cpuinfo 
        Hardware	: QNAP TS-119/TS-219
        $ cat /proc/device-tree/model ; echo
        cat: /proc/device-tree/model: No such file or directory
        
        $ lspci
        $ ls /sys/bus/pci/devices/
        $ ls /sys/class/pci_bus/
        0000:00@
        $ dmesg | grep -i pci
        [    5.024108] Kirkwood PCIe port 0: 
        [    5.024126] Kirkwood PCIe port 1: 
        [    5.024143] PCI: bus0 uses PCIe port 1
        [    5.024342] PCI: bus0: Fast back to back transfers enabled
        [    5.048486] PCI: CLS 0 bytes, default 32
        $ dmesg | grep 628
        [    5.022263] Kirkwood: MV88F6281-A1, TCLK=200000000.
        
ts219-setup.c and ts41x-setup.c don't appear to differ meaningfully in
their pcie setup -- i.e. they both call kirkwood_pcie_init, so I suppose
the difference is whether there is anything on the bus or not.

Is the lack of anything on the PCI bus itself sufficient to determine
that this is a 6281 based ts219 rather than a 6282 one (I don't have any
6282 ts219 systems to try)?

Might PHYAD (reported by ethtool eth0) be a useful fallback mechanism?
AIUI the phy addr is 8 for 6281 systems and 0 for 6282 ones.

Any other ideas?

Also the ts219-setup.c board file supports the ts119 as well, but I
don't see a DTB for that, is that in the works? Any ideas how I can
distinguish a 219 from a 119? On the 219 /sys/class/pci_bus/0000:00
exists (there is nothing under /sys/bus/pci/devices/ though), and since
the main difference in ts219-setup.c is that 119 doesn't call
kirkwood_pcie_init() I suspect the presence or absence
of /sys/class/pci_bus/0000:00 might be sufficient to distinguish them,
does that sound likely? (I don't have a ts119 to try either).

Thanks for any advice.

Ian.

  parent reply	other threads:[~2014-05-03 13:19 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 23:41 [PATCH 00/21] Move DT kirkwood into mach-mvebu Andrew Lunn
2014-02-06 23:41 ` [PATCH 01/21] ARM: Kirkwood: Give pm.c its own header file Andrew Lunn
2014-02-06 23:41 ` [PATCH 02/21] IRQ: Orion: Fix getting generic chip pointer Andrew Lunn
2014-02-07  2:38   ` Jason Cooper
2014-02-07 22:32   ` Sebastian Hesselbarth
2014-02-08 15:45     ` Jason Cooper
2014-02-06 23:41 ` [PATCH 03/21] ARM: Kirkwood: Convert mv88f6281gtw_ge switch setup to DT Andrew Lunn
2014-02-07  8:25   ` Thomas Petazzoni
2014-02-07  9:02     ` Andrew Lunn
2014-02-06 23:42 ` [PATCH 04/21] ARM: Kirkwood: Drop printing the SoC type and revision Andrew Lunn
2014-02-06 23:42 ` [PATCH 05/21] ARM: Kirkwood: Seperate board-dt from common and pcie code Andrew Lunn
2014-02-06 23:42 ` [PATCH 06/21] ARM: Kirkwood: ioremap the cpu_config register before using it Andrew Lunn
2014-02-06 23:42 ` [PATCH 07/21] ARM: Kirkwood: ioremap memory control register Andrew Lunn
2014-02-06 23:42 ` [PATCH 08/21] ARM: MVEBU: Add ARCH_MULTI_V7 to SoCs Andrew Lunn
2014-02-06 23:42 ` [PATCH 09/21] ARM: Orion: Move cache-feroceon-l2.h out of plat-orion Andrew Lunn
2014-02-06 23:42 ` [PATCH 10/21] ARM: MM: Add DT binding for Feroceon L2 cache Andrew Lunn
2014-02-07  0:51   ` Jason Gunthorpe
2014-02-07  1:27   ` Jason Cooper
2014-02-07  9:32     ` Andrew Lunn
2014-02-07 14:31       ` Jason Cooper
2014-02-07 18:13       ` Jason Gunthorpe
2014-02-07 14:48   ` Sudeep Holla
2014-02-07 18:21     ` Jason Gunthorpe
2014-02-07 19:12       ` Sudeep Holla
2014-02-06 23:42 ` [PATCH 11/21] ARM: Fix default CPU selection for ARCH_MULTI_V5 Andrew Lunn
2014-02-06 23:42 ` [PATCH 12/21] ARM: Fix MULTI_TLB for feroceon Andrew Lunn
2014-02-06 23:42 ` [PATCH 13/21] ARM: MM Enable building Feroceon L2 cache controller with ARCH_MVEBU Andrew Lunn
2014-02-06 23:42 ` [PATCH 14/21] ARM: Move kirkwood DT boards into mach-mvebu Andrew Lunn
2014-02-06 23:42 ` [PATCH 15/21] ARM: MVEBU: Let kirkwood use the system controller for restart Andrew Lunn
2014-02-07  1:37   ` Jason Cooper
2014-02-06 23:42 ` [PATCH 16/21] drivers: Enable building of Kirkwood drivers for mach-mvebu Andrew Lunn
2014-02-07  1:59   ` Jason Cooper
2014-02-07  9:13     ` Andrew Lunn
2014-02-07 14:35       ` Jason Cooper
2014-02-06 23:42 ` [PATCH 17/21] ARM: MVEBU: Enable mvebu-soc-id on Kirkwood Andrew Lunn
2014-02-06 23:42 ` [PATCH 18/21] ARM: config: Add a multi_v5_defconfig Andrew Lunn
2014-02-06 23:42 ` [PATCH 19/21] ARM: MVEBU: Simplifiy headers and make local Andrew Lunn
2014-02-07  8:31   ` Thomas Petazzoni
2014-02-07  9:20     ` Andrew Lunn
2014-02-07  9:36       ` Thomas Petazzoni
2014-02-07  9:45         ` Andrew Lunn
2014-02-07 18:27     ` Jason Gunthorpe
2014-02-06 23:42 ` [PATCH 20/21] ARM: MVEBU: Remove unneeded headers Andrew Lunn
2014-02-07  2:02   ` Jason Cooper
2014-02-06 23:42 ` [PATCH 21/21] ARM: Kirkwood: Remove DT support Andrew Lunn
2014-02-07  8:33   ` Thomas Petazzoni
2014-02-07  9:12     ` Andrew Lunn
2014-02-07 15:03     ` Jason Cooper
2014-02-07 15:09       ` Thomas Petazzoni
2014-02-07 15:15         ` Jason Cooper
2014-02-07 17:31           ` Sebastian Hesselbarth
2014-02-10 18:09         ` Andrew Lunn
2014-02-07 17:34   ` Sebastian Hesselbarth
2014-02-07 18:48     ` Jason Cooper
2014-02-20 10:30     ` Ian Campbell
2014-02-20 10:58       ` Andrew Lunn
2014-02-20 11:19         ` Russell King - ARM Linux
2014-02-20 11:28           ` Andrew Lunn
2014-02-20 11:39           ` Ian Campbell
2014-02-20 23:26             ` Jason Cooper
2014-02-24 16:00               ` Ian Campbell
2014-02-24 16:24                 ` Andrew Lunn
2014-02-24 16:26                   ` Ian Campbell
2014-02-24 16:34                     ` Jason Cooper
2014-05-03 13:19                   ` Ian Campbell [this message]
2014-05-03 14:40                     ` Automatically detecting when to use kirkwood-tsXXX-6281.dtb vs -6282.dtb (Was: Re: [PATCH 21/21] ARM: Kirkwood: Remove DT support) Andrew Lunn
2014-05-05  8:44                       ` Ian Campbell
2014-02-20 11:34         ` [PATCH 21/21] ARM: Kirkwood: Remove DT support Ian Campbell
2014-02-20 12:18           ` Andrew Lunn
2014-02-20 12:51             ` Ian Campbell
2014-02-20 13:23               ` Andrew Lunn
2014-02-20 14:24                 ` Ian Campbell
2014-02-21  2:00                   ` Ben Hutchings
2014-02-21 13:16                     ` Arnd Bergmann
2014-02-24 16:03                     ` Ian Campbell
2014-02-24 20:09                       ` Ben Hutchings
2014-02-20 13:53               ` Arnd Bergmann
2014-02-20 14:21                 ` Ian Campbell
2014-02-20 15:19                   ` Arnd Bergmann
2014-02-21  1:47                     ` Ben Hutchings
2014-02-21 13:07                       ` Arnd Bergmann
2014-02-21 15:58                         ` Jason Cooper
2014-02-21 19:51                         ` Ben Hutchings
2014-02-20 13:04             ` Arnd Bergmann
2014-02-20 14:22               ` Ian Campbell
2014-02-20 12:09         ` Arnd Bergmann
2014-02-20 23:24         ` Jason Cooper
2014-02-21 15:52           ` Thomas Petazzoni
2014-02-21 16:36             ` Arnd Bergmann
2014-02-21 16:41               ` Andrew Lunn
2014-02-21 16:42               ` Jason Cooper
2014-02-23 21:44               ` Simon Guinot
2014-02-25 12:44                 ` Arnd Bergmann
2014-02-25 13:05                   ` Simon Guinot
2014-02-25 15:36                     ` Arnd Bergmann
2014-02-25 15:09                       ` Simon Guinot
2014-02-25 15:59                         ` Arnd Bergmann
2014-02-07  1:14 ` [PATCH 00/21] Move DT kirkwood into mach-mvebu Jason Cooper

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=1399123167.23380.163.camel@dagon.hellion.org.uk \
    --to=ijc@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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.