From: Arnd Bergmann <arnd@arndb.de>
To: Kevin Cernekee <cernekee@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
Florian Fainelli <f.fainelli@gmail.com>,
Jon Fraser <jfraser@broadcom.com>,
dtor@chromium.org, Thomas Gleixner <tglx@linutronix.de>,
Jason Cooper <jason@lakedaemon.net>,
Linux MIPS Mailing List <linux-mips@linux-mips.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2 22/22] MIPS: Add multiplatform BMIPS target
Date: Mon, 17 Nov 2014 13:16:03 +0100 [thread overview]
Message-ID: <3480616.V2TMJFc7uE@wuerfel> (raw)
In-Reply-To: <CAJiQ=7C-HniwXiVrqQg3cnFNNYGwoxHJf8JP-XYOqM1yWoyXaw@mail.gmail.com>
On Sunday 16 November 2014 14:12:44 Kevin Cernekee wrote:
> On Sun, Nov 16, 2014 at 1:24 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Saturday 15 November 2014 16:17:46 Kevin Cernekee wrote:
> >> +config BMIPS_MULTIPLATFORM
> >> + bool "Broadcom BCM33xx/BCM63xx/BCM7xxx multiplatform kernel"
> >> + select BOOT_RAW
> >> + select NO_EXCEPT_FILL
> >> + select USE_OF
> >> + select BUILTIN_DTB
> >> + select FW_CFE
> >> + select CEVT_R4K
> >> + select CSRC_R4K
> >> + select SYNC_R4K
> >> + select COMMON_CLK
> >> + select BCM7038_L1_IRQ
> >> + select BCM7120_L2_IRQ
> >> + select BRCMSTB_L2_IRQ
> >> + select IRQ_CPU
> >> + select RAW_IRQ_ACCESSORS
> >> + select DMA_NONCOHERENT
> >> + select SYS_SUPPORTS_32BIT_KERNEL
> >> + select SYS_SUPPORTS_LITTLE_ENDIAN
> >> + select SYS_SUPPORTS_BIG_ENDIAN
> >> + select SYS_SUPPORTS_HIGHMEM
> >> + select SYS_HAS_CPU_BMIPS3300
> >> + select SYS_HAS_CPU_BMIPS4350
> >> + select SYS_HAS_CPU_BMIPS4380
> >> + select SYS_HAS_CPU_BMIPS5000
> >> + select SWAP_IO_SPACE
> >> + select USB_EHCI_BIG_ENDIAN_DESC
> >> + select USB_EHCI_BIG_ENDIAN_MMIO
> >> + select USB_OHCI_BIG_ENDIAN_DESC
> >> + select USB_OHCI_BIG_ENDIAN_MMIO
> >
> > You mentioned in another thread that all MMIO is byteswapped based on the
> > jumper setting. Should the USB options have an 'if CPU_BIG_ENDIAN'
> > behind them? I think it will still work in the current way, but when you
> > know that you have little-endian registers, it is more efficient
> > not to set these.
>
> Right, it works OK this way because the USB_*_BIG_ENDIAN_* options
> just allow the USB drivers to accept the "big-endian" DT property.
> They don't actually force any endian swaps on their own.
>
> I can add the extra condition if warranted. On an LE build it saves
> about 19kB = 0.3% in .text:
>
> $ size vmlinux vmlinux.orig
> text data bss dec hex filename
> 5945044 6227964 263936 12436944 bdc5d0 vmlinux
> 5963924 6227964 263936 12455824 be0f90 vmlinux.orig
>
> ("data" includes an initramfs so it's huge, but removing it doesn't
> impact the "text" column.)
I think 19kb is worth it, though I was actually more interested in the
runtime overhead.
> At some point I'd also like to get the of_device_is_big_endian() patch
> merged, and then use it to harmonize the way endian swapping works
> across serial8250, libahci, and maybe USB. Depending on the
> size/complexity impact and the level of passion surrounding the topic,
> this might also involve getting rid of the compile-time optimizations,
> or at least simplifying them down to a single option instead of 6.
Yes, good idea.
> > It's probably not a wrong description here, but for anybody reading this
> > who also works on ARM, it seems rather confusing because there,
> > "multiplatform" implies that the particular SoC can be built into a
> > generic kernel image that supports SoCs from any vendor whose platform
> > is also marked as "multiplatform", as long as the CPU architecture level
> > (v4/v5, or v6/v7, or v8) is the same.
>
> The BMIPS multiplatform kernel is intended to support any SoC based on
> a 65nm/40nm/28nm BMIPS CPU. Strictly speaking, "BMIPS" isn't an
> architecture level defined by imgtec, nor is it something that other
> silicon vendors can currently offer. But the BMIPS CPUs do have their
> own unique CP0 registers, DSP instruction set, errata, and ways of
> handling SMP / cache maintenance / performance counters.
Ok, I see. It looks like you can have a combined kernel that runs on
BMIPS BCM47xx and MIPS32r2 74K BCM47xx already, right?
So it's not fundamentally incompatible with the other platforms?
> Outside of the CPU, the BCM63xx/BCM33xx/BCM7xxx register maps and
> peripherals look pretty different, and the arch/mips/bmips code makes
> almost zero assumptions about the rest of the chip if a DTB is passed
> in from the bootloader. In this sense you can see the parallels to
> CONFIG_ARCH_MULTI_Vx.
>
> Prior to this work, these product lines have never been able to share
> a common kernel image.
I still think this is different in the sense that ARM multiplatform
support is about combining platforms from separate mach-* directories,
while your approach was to rewrite multiple mach-* directories into
a single new one that remains separate from the others. While this is
a great improvement, it doesn't get you any closer to having a
combined BMIPS+RALINK+JZ4740+ATH79 kernel for instance. I don't know
if such a kernel is something that anybody wants, or if it's even
technically possible.
If you wanted to do that however, starting with BMIPS you'd have
to make it possible to define a new platform without the
arch/mips/include/asm/mach-bmips/ directory (this should be possible
already, so the hardest part is done), replace all global function
calls (arch_init_irq, prom_init, get_system_type, ...) with generic
platform-independent implementations or wrappers around per-platform
callbacks, and move the Kconfig section for CONFIG_BMIPS_MULTIPLATFORM
outside of the "System type" choice statement.
Until you do that, your platform isn't "more multipliplatform" than
the others really, it just abstracts the differences between some
SoCs nicer than most.
Arnd
next prev parent reply other threads:[~2014-11-17 12:16 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-16 0:17 [PATCH V2 00/22] Multiplatform BMIPS kernel Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 01/22] irqchip: Update docs regarding irq_domain_add_tree() Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 02/22] irqchip: brcmstb-l2: fix error handling of irq_of_parse_and_map Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 03/22] irqchip: bcm7120-l2: " Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 04/22] irqchip: bcm7120-l2: Refactor driver for arbitrary IRQEN/IRQSTAT offsets Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 05/22] irqchip: bcm7120-l2: Change DT binding to allow non-contiguous IRQEN/IRQSTAT Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 06/22] irqchip: Add new driver for BCM7038-style level 1 interrupt controllers Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 07/22] MIPS: BMIPS: Fix ".previous without corresponding .section" warnings Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 08/22] MIPS: BMIPS: Align secondary boot sequence with latest firmware releases Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 09/22] MIPS: BMIPS: Introduce helper function to change the reset vector Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 10/22] MIPS: BMIPS: Allow BMIPS3300 to utilize SMP ebase relocation code Kevin Cernekee
2014-11-20 23:40 ` Ralf Baechle
2014-11-16 0:17 ` [PATCH V2 11/22] MIPS: BMIPS: Mask off timer IRQs when hot-unplugging a CPU Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 12/22] MIPS: BMIPS: Explicitly configure reset vectors prior to secondary boot Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 13/22] MIPS: Allow MIPS_CPU_SCACHE to be used with different line sizes Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 14/22] MIPS: BMIPS: Fix L1_CACHE_SHIFT when BMIPS5000 is selected Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 15/22] MIPS: BMIPS: Let each platform customize the CPU1 IRQ mask Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 16/22] MIPS: BMIPS: Add special cache handling in c-r4k.c Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 17/22] MIPS: BMIPS: Add PRId for BMIPS5200 (Whirlwind) Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 18/22] MIPS: Create a helper function for DT setup Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 19/22] Documentation: DT: Add "mti" vendor prefix Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 20/22] MAINTAINERS: Add entry for bcm63xx/bcm33xx UDC gadget driver Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 21/22] MAINTAINERS: Add entry for BMIPS multiplatform kernel Kevin Cernekee
2014-11-16 0:17 ` [PATCH V2 22/22] MIPS: Add multiplatform BMIPS target Kevin Cernekee
2014-11-16 21:24 ` Arnd Bergmann
2014-11-16 22:12 ` Kevin Cernekee
2014-11-17 12:16 ` Arnd Bergmann [this message]
2014-11-17 14:52 ` Jonas Gorski
2014-11-17 16:13 ` Arnd Bergmann
2014-11-17 17:19 ` Kevin Cernekee
2014-11-17 18:55 ` Arnd Bergmann
2014-11-17 19:47 ` Kevin Cernekee
2014-11-17 20:33 ` Arnd Bergmann
2014-11-17 21:57 ` Kevin Cernekee
2014-11-18 10:15 ` Arnd Bergmann
2014-11-17 17:01 ` Kevin Cernekee
2014-11-17 18:46 ` Arnd Bergmann
2014-11-17 19:39 ` Kevin Cernekee
2014-11-17 20:40 ` Arnd Bergmann
2014-11-17 21:21 ` Kevin Cernekee
2014-11-17 23:06 ` Jonas Gorski
2014-11-18 10:19 ` Arnd Bergmann
2014-11-17 14:44 ` Jonas Gorski
2014-11-17 20:35 ` Kevin Cernekee
2014-11-17 23:00 ` Jonas Gorski
2014-11-20 3:04 ` [PATCH V2 00/22] Multiplatform BMIPS kernel Brian Norris
2014-11-20 3:55 ` Kevin Cernekee
2014-11-20 18:09 ` Florian Fainelli
2014-11-20 20:13 ` Kevin Cernekee
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=3480616.V2TMJFc7uE@wuerfel \
--to=arnd@arndb.de \
--cc=cernekee@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dtor@chromium.org \
--cc=f.fainelli@gmail.com \
--cc=jason@lakedaemon.net \
--cc=jfraser@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox