Generic BMIPS kernel
Subsystems (8)
v4 cover Generic BMIPS kernel
This patch series REPLACES the following commits in Ralf's mips-for-linux-next branch:
846deacebfe1 Documentation: DT: Add entries for BCM3384 and its peripherals d666cd0246f7 MIPS: bcm3384: Initial commit of bcm3384 platform support a2f6734c5f68 MAINTAINERS: Add entry for BCM33xx cable chips
(if you just want to drop the above commits and target this for 3.20+, that's fine.)
V3->V4:
- Rename "Multiplatform BMIPS kernel" to "Generic BMIPS kernel".
- Split the "Generic BMIPS kernel" work into two separate commits: one for code and one for DTS.
- Drop set_io_port_base stuff; this can be added later when PCI(e) support is done.
- Document the boot interface (entry points, register contents).
- Document the special FIXMAP requirement.
- Create a mach-generic/war.h to reduce copy/paste.
- Change "compatible" strings to distinguish bcm7120-style "IRQEN/IRQSTAT" controllers from bcm3380-style "free form" controllers.
- Add DT nodes for brcmstb-reboot.c and brcmstb_gisb.c.
- Rebase on Ralf's latest tree.
This series is based on mips-for-linux-next, minus the three 3384 patches listed above, plus these non-MIPS patches:
http://patchwork.linux-mips.org/bundle/cernekee/bmips-multi-v4-deps/?state=%2a
http://marc.info/?l=linux-usb&m=141305106215886&w=2 (all 3/3)
http://marc.info/?l=linux-usb&m=141696309127730&w=2 (all 9/9)
I believe the irq-b*-l2.c patches are the only compile-time dependencies; you may want to take 01-08 through the irqchip tree since they build on top of other pending commits there.
My branch can be viewed here:
https://github.com/Broadcom/stblinux/commits/bmips-generic-v4
Brian Norris (1):
irqchip: brcmstb-l2: don't clear wakeable interrupts at init time
Dmitry Torokhov (2):
irqchip: brcmstb-l2: fix error handling of irq_of_parse_and_map
irqchip: bcm7120-l2: fix error handling of irq_of_parse_and_map
Kevin Cernekee (13):
irqchip: Update docs regarding irq_domain_add_tree()
irqchip: bcm7120-l2: Refactor driver for arbitrary IRQEN/IRQSTAT
offsets
irqchip: bcm7120-l2: Split STB-specific logic into its own function
irqchip: bcm7120-l2: Add support for BCM3380-style controllers
irqchip: Add new driver for BCM7038-style level 1 interrupt
controllers
MIPS: Let __dt_register_buses accept a single bus type
MIPS: Fall back to the generic restart notifier
MIPS: Reorder MIPS_L1_CACHE_SHIFT priorities
MIPS: Create a common <asm/mach-generic/war.h>
MIPS: BMIPS: Flush the readahead cache after DMA
MIPS: BMIPS: Document the firmware->kernel DTB interface
MIPS: Add Generic BMIPS target
MIPS: BMIPS: Add DTS files for several platforms
Documentation/IRQ-domain.txt | 3 +- .../interrupt-controller/brcm,bcm3380-l2-intc.txt | 41 +++ .../interrupt-controller/brcm,bcm7038-l1-intc.txt | 52 ++++ .../interrupt-controller/brcm,bcm7120-l2-intc.txt | 12 +- .../devicetree/bindings/mips/brcm/bmips.txt | 8 + .../devicetree/bindings/mips/brcm/soc.txt | 12 + Documentation/devicetree/booting-without-of.txt | 28 ++ arch/mips/Kbuild.platforms | 1 + arch/mips/Kconfig | 41 ++- arch/mips/bmips/Kconfig | 50 +++ arch/mips/bmips/Makefile | 1 + arch/mips/bmips/Platform | 7 + arch/mips/bmips/dma.c | 121 ++++++++ arch/mips/bmips/irq.c | 38 +++ arch/mips/bmips/setup.c | 191 ++++++++++++ arch/mips/boot/dts/Makefile | 9 + arch/mips/boot/dts/bcm3384_viper.dtsi | 108 +++++++ arch/mips/boot/dts/bcm3384_zephyr.dtsi | 126 ++++++++ arch/mips/boot/dts/bcm6328.dtsi | 86 ++++++ arch/mips/boot/dts/bcm6368.dtsi | 93 ++++++ arch/mips/boot/dts/bcm7125.dtsi | 139 +++++++++ arch/mips/boot/dts/bcm7346.dtsi | 224 ++++++++++++++ arch/mips/boot/dts/bcm7360.dtsi | 161 ++++++++++ arch/mips/boot/dts/bcm7420.dtsi | 184 +++++++++++ arch/mips/boot/dts/bcm7425.dtsi | 225 ++++++++++++++ arch/mips/boot/dts/bcm93384wvg.dts | 25 ++ arch/mips/boot/dts/bcm93384wvg_viper.dts | 25 ++ arch/mips/boot/dts/bcm96368mvwg.dts | 31 ++ arch/mips/boot/dts/bcm97125cbmb.dts | 31 ++ arch/mips/boot/dts/bcm97346dbsmb.dts | 58 ++++ arch/mips/boot/dts/bcm97360svmb.dts | 34 +++ arch/mips/boot/dts/bcm97420c.dts | 45 +++ arch/mips/boot/dts/bcm97425svmb.dts | 60 ++++ arch/mips/boot/dts/bcm9ejtagprb.dts | 22 ++ arch/mips/configs/bmips_be_defconfig | 88 ++++++ arch/mips/configs/bmips_stb_defconfig | 88 ++++++ arch/mips/include/asm/mach-ar7/war.h | 24 -- arch/mips/include/asm/mach-ath25/war.h | 25 -- arch/mips/include/asm/mach-ath79/war.h | 24 -- arch/mips/include/asm/mach-au1x00/war.h | 24 -- arch/mips/include/asm/mach-bcm47xx/war.h | 24 -- arch/mips/include/asm/mach-bcm63xx/war.h | 24 -- arch/mips/include/asm/mach-bmips/dma-coherence.h | 48 +++ arch/mips/include/asm/mach-bmips/spaces.h | 18 ++ arch/mips/include/asm/mach-cavium-octeon/war.h | 25 -- arch/mips/include/asm/mach-cobalt/war.h | 24 -- arch/mips/include/asm/mach-dec/war.h | 24 -- arch/mips/include/asm/mach-emma2rh/war.h | 24 -- arch/mips/include/asm/mach-generic/war.h | 24 ++ arch/mips/include/asm/mach-jazz/war.h | 24 -- arch/mips/include/asm/mach-jz4740/war.h | 24 -- arch/mips/include/asm/mach-lantiq/war.h | 23 -- arch/mips/include/asm/mach-lasat/war.h | 24 -- arch/mips/include/asm/mach-loongson/war.h | 24 -- arch/mips/include/asm/mach-loongson1/war.h | 24 -- arch/mips/include/asm/mach-netlogic/war.h | 25 -- arch/mips/include/asm/mach-paravirt/war.h | 25 -- arch/mips/include/asm/mach-pnx833x/war.h | 24 -- arch/mips/include/asm/mach-ralink/war.h | 24 -- arch/mips/include/asm/mach-tx39xx/war.h | 24 -- arch/mips/include/asm/mach-vr41xx/war.h | 24 -- arch/mips/kernel/prom.c | 5 +- arch/mips/kernel/reset.c | 2 + arch/mips/mm/dma-default.c | 13 + drivers/irqchip/Kconfig | 5 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-bcm7038-l1.c | 335 +++++++++++++++++++++ drivers/irqchip/irq-bcm7120-l2.c | 197 ++++++++---- drivers/irqchip/irq-brcmstb-l2.c | 13 +- 69 files changed, 3048 insertions(+), 612 deletions(-) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/brcm,bcm3380-l2-intc.txt create mode 100644 Documentation/devicetree/bindings/interrupt-controller/brcm,bcm7038-l1-intc.txt create mode 100644 Documentation/devicetree/bindings/mips/brcm/bmips.txt create mode 100644 Documentation/devicetree/bindings/mips/brcm/soc.txt create mode 100644 arch/mips/bmips/Kconfig create mode 100644 arch/mips/bmips/Makefile create mode 100644 arch/mips/bmips/Platform create mode 100644 arch/mips/bmips/dma.c create mode 100644 arch/mips/bmips/irq.c create mode 100644 arch/mips/bmips/setup.c create mode 100644 arch/mips/boot/dts/bcm3384_viper.dtsi create mode 100644 arch/mips/boot/dts/bcm3384_zephyr.dtsi create mode 100644 arch/mips/boot/dts/bcm6328.dtsi create mode 100644 arch/mips/boot/dts/bcm6368.dtsi create mode 100644 arch/mips/boot/dts/bcm7125.dtsi create mode 100644 arch/mips/boot/dts/bcm7346.dtsi create mode 100644 arch/mips/boot/dts/bcm7360.dtsi create mode 100644 arch/mips/boot/dts/bcm7420.dtsi create mode 100644 arch/mips/boot/dts/bcm7425.dtsi create mode 100644 arch/mips/boot/dts/bcm93384wvg.dts create mode 100644 arch/mips/boot/dts/bcm93384wvg_viper.dts create mode 100644 arch/mips/boot/dts/bcm96368mvwg.dts create mode 100644 arch/mips/boot/dts/bcm97125cbmb.dts create mode 100644 arch/mips/boot/dts/bcm97346dbsmb.dts create mode 100644 arch/mips/boot/dts/bcm97360svmb.dts create mode 100644 arch/mips/boot/dts/bcm97420c.dts create mode 100644 arch/mips/boot/dts/bcm97425svmb.dts create mode 100644 arch/mips/boot/dts/bcm9ejtagprb.dts create mode 100644 arch/mips/configs/bmips_be_defconfig create mode 100644 arch/mips/configs/bmips_stb_defconfig delete mode 100644 arch/mips/include/asm/mach-ar7/war.h delete mode 100644 arch/mips/include/asm/mach-ath25/war.h delete mode 100644 arch/mips/include/asm/mach-ath79/war.h delete mode 100644 arch/mips/include/asm/mach-au1x00/war.h delete mode 100644 arch/mips/include/asm/mach-bcm47xx/war.h delete mode 100644 arch/mips/include/asm/mach-bcm63xx/war.h create mode 100644 arch/mips/include/asm/mach-bmips/dma-coherence.h create mode 100644 arch/mips/include/asm/mach-bmips/spaces.h delete mode 100644 arch/mips/include/asm/mach-cavium-octeon/war.h delete mode 100644 arch/mips/include/asm/mach-cobalt/war.h delete mode 100644 arch/mips/include/asm/mach-dec/war.h delete mode 100644 arch/mips/include/asm/mach-emma2rh/war.h create mode 100644 arch/mips/include/asm/mach-generic/war.h delete mode 100644 arch/mips/include/asm/mach-jazz/war.h delete mode 100644 arch/mips/include/asm/mach-jz4740/war.h delete mode 100644 arch/mips/include/asm/mach-lantiq/war.h delete mode 100644 arch/mips/include/asm/mach-lasat/war.h delete mode 100644 arch/mips/include/asm/mach-loongson/war.h delete mode 100644 arch/mips/include/asm/mach-loongson1/war.h delete mode 100644 arch/mips/include/asm/mach-netlogic/war.h delete mode 100644 arch/mips/include/asm/mach-paravirt/war.h delete mode 100644 arch/mips/include/asm/mach-pnx833x/war.h delete mode 100644 arch/mips/include/asm/mach-ralink/war.h delete mode 100644 arch/mips/include/asm/mach-tx39xx/war.h delete mode 100644 arch/mips/include/asm/mach-vr41xx/war.h create mode 100644 drivers/irqchip/irq-bcm7038-l1.c
Signature · 1 line
2.1.0
PATCH v4 1/16 irqchip: Update docs regarding irq_domain_add_tree()
Several drivers now use this API, including the ARM GIC driver, so remove the outdated comment.
--- Documentation/IRQ-domain.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Documentation/IRQ-domain.txt +1 -2
@@ -95,8 +95,7 @@ since it doesn't need to allocate a table as large as the largest hwirq number. The disadvantage is that hwirq to IRQ number lookup is dependent on how many entries are in the table. -Very few drivers should need this mapping. At the moment, powerpc -iseries is the only user. +Very few drivers should need this mapping. ==== No Map ===- irq_domain_add_nomap()
Signature · 1 line
2.1.0
PATCH v4 2/16 irqchip: brcmstb-l2: don't clear wakeable interrupts at init time
In reply to Kevin CernekeeFrom: Brian Norris <[email protected]>
Wakeable interrupts might be pending at boot/init time, because wakeup interrupts might have triggered a resume from S5. So don't clear such wakeups.
This means that any driver which requests a wakeable interrupt bit should be prepared to handle an interrupt as soon as they call request_irq(). (This is technically already the correct development practice, but some drivers probably expect not to receive interrupts until they have performed some I/O.)
--- drivers/irqchip/irq-brcmstb-l2.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/irqchip/irq-brcmstb-l2.c +6 -3
@@ -136,7 +136,11 @@ int __init brcmstb_l2_intc_of_init(struct device_node *np,/* Disable all interrupts by default */ writel (0xffffffff , data->base +CPU_MASK_SET ); -writel (0xffffffff , data->base +CPU_CLEAR ); + +/* Wakeup interrupts may be retained from S5 (cold boot) */ + data->can_wake =of_property_read_bool (np,"brcm,irq-can-wake" ); +if (!data->can_wake) +writel (0xffffffff , data->base +CPU_CLEAR ); data->parent_irq =irq_of_parse_and_map (np,0 );if (data->parent_irq <0 ) {
@@ -188,8 +192,7 @@ int __init brcmstb_l2_intc_of_init(struct device_node *np, ct->chip.irq_suspend = brcmstb_l2_intc_suspend; ct->chip.irq_resume = brcmstb_l2_intc_resume; -if (of_property_read_bool (np,"brcm,irq-can-wake" )) { - data->can_wake = true; +if (data->can_wake) {/* This IRQ chip can wake the system, set all child interrupts * in wake_enabled mask */
Signature · 1 line
2.1.0
PATCH v4 3/16 irqchip: brcmstb-l2: fix error handling of irq_of_parse_and_map
In reply to Kevin CernekeeFrom: Dmitry Torokhov <[email protected]>
Return value of irq_of_parse_and_map() is unsigned int, with 0 indicating failure, so testing for negative result never works.
--- drivers/irqchip/irq-brcmstb-l2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/irqchip/irq-brcmstb-l2.c +2 -2
@@ -143,9 +143,9 @@ int __init brcmstb_l2_intc_of_init(struct device_node *np,writel (0xffffffff , data->base +CPU_CLEAR ); data->parent_irq =irq_of_parse_and_map (np,0 ); -if (data->parent_irq <0 ) { +if (!data->parent_irq) {pr_err ("failed to find parent interrupt\n" ); - ret = data->parent_irq; + ret = -EINVAL ; goto out_unmap; }
Signature · 1 line
2.1.0
PATCH v4 4/16 irqchip: bcm7120-l2: fix error handling of irq_of_parse_and_map
In reply to Kevin CernekeeFrom: Dmitry Torokhov <[email protected]>
Return value of irq_of_parse_and_map() is unsigned int, with 0 indicating failure, so testing for negative result never works.
--- drivers/irqchip/irq-bcm7120-l2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/irqchip/irq-bcm7120-l2.c +2 -2
@@ -102,9 +102,9 @@ static int bcm7120_l2_intc_init_one(struct device_node *dn,unsigned int idx; parent_irq =irq_of_parse_and_map (dn, irq); -if (parent_irq <0 ) { +if (!parent_irq) {pr_err ("failed to map interrupt %d\n" , irq); -return parent_irq; +return -EINVAL ; }/* For multiple parent IRQs with multiple words, this looks like:
Signature · 1 line
2.1.0
PATCH v4 5/16 irqchip: bcm7120-l2: Refactor driver for arbitrary IRQEN/IRQSTAT offsets
In reply to Kevin CernekeeCurrently the driver assumes that REG_BASE+0x00 is the IRQ enable mask, and REG_BASE+0x04 is the IRQ status mask. This is true on BCM3384 and BCM7xxx, but it is not true for some of the controllers found on BCM63xx chips. So we will change a couple of key assumptions:
- Don't assume that both the IRQEN and IRQSTAT registers will be covered by a single ioremap() operation.
- Don't assume any particular ordering (IRQSTAT might show up before IRQEN on some chips).
- For an L2 controller with >=64 IRQs, don't assume that every IRQEN/IRQSTAT pair will use the same register spacing.
This patch changes the "plumbing" but doesn't yet provide a way for users to instantiate a controller with arbitrary IRQEN/IRQSTAT offsets.
--- drivers/irqchip/irq-bcm7120-l2.c | 41 +++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-)
drivers/irqchip/irq-bcm7120-l2.c +28 -13
@@ -34,11 +34,15 @@#define IRQSTAT 0x04#define MAX_WORDS 4 +#define MAX_MAPPINGS MAX_WORDS#define IRQS_PER_WORD 32struct bcm7120_l2_intc_data {unsigned int n_words; -void __iomem *base[MAX_WORDS ]; +void __iomem *map_base[MAX_MAPPINGS ]; +void __iomem *pair_base[MAX_WORDS ]; +int en_offset[MAX_WORDS ]; +int stat_offset[MAX_WORDS ];struct irq_domain *domain;bool can_wake;u32 irq_fwd_mask[MAX_WORDS ];
@@ -61,7 +65,8 @@ static void bcm7120_l2_intc_irq_handle(unsigned int irq, struct irq_desc *desc)int hwirq;irq_gc_lock (gc); - pending =irq_reg_readl (gc,IRQSTAT ) & gc->mask_cache; + pending =irq_reg_readl (gc, b->stat_offset[idx]) & + gc->mask_cache;irq_gc_unlock (gc);for_each_set_bit (hwirq, &pending,IRQS_PER_WORD ) {
@@ -76,21 +81,24 @@ static void bcm7120_l2_intc_irq_handle(unsigned int irq, struct irq_desc *desc)static void bcm7120_l2_intc_suspend (struct irq_data *d) {struct irq_chip_generic *gc =irq_data_get_irq_chip_data (d); +struct irq_chip_type *ct =irq_data_get_chip_type (d);struct bcm7120_l2_intc_data *b = gc->private;irq_gc_lock (gc);if (b->can_wake) -irq_reg_writel (gc, gc->mask_cache | gc->wake_active,IRQEN ); +irq_reg_writel (gc, gc->mask_cache | gc->wake_active, + ct->regs.mask);irq_gc_unlock (gc); }static void bcm7120_l2_intc_resume (struct irq_data *d) {struct irq_chip_generic *gc =irq_data_get_irq_chip_data (d); +struct irq_chip_type *ct =irq_data_get_chip_type (d);/* Restore the saved mask */ irq_gc_lock (gc); -irq_reg_writel (gc, gc->mask_cache,IRQEN ); +irq_reg_writel (gc, gc->mask_cache, ct->regs.mask);irq_gc_unlock (gc); }
@@ -137,9 +145,14 @@ int __init bcm7120_l2_intc_of_init(struct device_node *dn,return -ENOMEM ;for (idx =0 ; idx <MAX_WORDS ; idx++) { - data->base[idx] =of_iomap (dn, idx); -if (!data->base[idx]) + data->map_base[idx] =of_iomap (dn, idx); +if (!data->map_base[idx])break ; + + data->pair_base[idx] = data->map_base[idx]; + data->en_offset[idx] =IRQEN ; + data->stat_offset[idx] =IRQSTAT ; + data->n_words = idx +1 ; }if (!data->n_words) {
@@ -157,7 +170,8 @@ int __init bcm7120_l2_intc_of_init(struct device_node *dn,if (ret ==0 || ret == -EINVAL ) {for (idx =0 ; idx < data->n_words; idx++)__raw_writel (data->irq_fwd_mask[idx], - data->base[idx] +IRQEN ); + data->pair_base[idx] + + data->en_offset[idx]); }else {/* property exists but has the wrong number of words */ pr_err ("invalid int-fwd-mask property\n" );
@@ -215,11 +229,12 @@ int __init bcm7120_l2_intc_of_init(struct device_node *dn, gc =irq_get_domain_generic_chip (data->domain, irq); gc->unused =0xffffffff & ~data->irq_map_mask[idx]; - gc->reg_base = data->base[idx]; gc->private = data; ct = gc->chip_types; - ct->regs.mask =IRQEN ; + gc->reg_base = data->pair_base[idx]; + ct->regs.mask = data->en_offset[idx]; + ct->chip.irq_mask = irq_gc_mask_clr_bit; ct->chip.irq_unmask = irq_gc_mask_set_bit; ct->chip.irq_ack = irq_gc_noop;
@@ -237,16 +252,16 @@ int __init bcm7120_l2_intc_of_init(struct device_node *dn, }pr_info ("registered BCM7120 L2 intc (mem: 0x%p, parent IRQ(s): %d)\n" , - data->base[0 ], num_parent_irqs); + data->map_base[0 ], num_parent_irqs);return 0 ; out_free_domain:irq_domain_remove (data->domain); out_unmap: -for (idx =0 ; idx <MAX_WORDS ; idx++) { -if (data->base[idx]) -iounmap (data->base[idx]); +for (idx =0 ; idx <MAX_MAPPINGS ; idx++) { +if (data->map_base[idx]) +iounmap (data->map_base[idx]); }kfree (data);return ret;
Signature · 1 line
2.1.0
PATCH v4 6/16 irqchip: bcm7120-l2: Split STB-specific logic into its own function
In reply to Kevin CernekeeThe BCM7xxx instances of this block (listed in the register manual as simply "IRQ0") all have the following items in common:
- brcm,int-map-mask: for routing different bits in the L2 to different parent IRQs
- brcm,int-fwd-mask: for hardwiring certain IRQs to bypass the L2 and use dedicated L1 lines
- one enable/status pair (32 bits only)
Much of the driver code can be shared with BCM3380-style controllers, but in order to do this cleanly, let's split out the BCM7xxx-specific logic first.
--- .../interrupt-controller/brcm,bcm7120-l2-intc.txt | 12 +- drivers/irqchip/irq-bcm7120-l2.c | 121 ++++++++++++--------- 2 files changed, 70 insertions(+), 63 deletions(-)
Documentation/devicetree/bindings/interrupt-controller/brcm,bcm7120-l2-intc.txt +3 -9
@@ -13,8 +13,7 @@ Such an interrupt controller has the following hardware design: or if they will output an interrupt signal at this 2nd level interrupt controller, in particular for UARTs -- typically has one 32-bit enable word and one 32-bit status word, but on - some hardware may have more than one enable/status pair +- has one 32-bit enable word and one 32-bit status word - no atomic set/clear operations
@@ -53,9 +52,7 @@ The typical hardware layout for this controller is represented below: Required properties: - compatible: should be "brcm,bcm7120-l2-intc" -- reg: specifies the base physical address and size of the registers; - multiple pairs may be specified, with the first pair handling IRQ offsets - 0..31 and the second pair handling 32..63 +- reg: specifies the base physical address and size of the registers - interrupt-controller: identifies the node as an interrupt controller - #interrupt-cells: specifies the number of cells needed to encode an interrupt source, should be 1.
@@ -66,10 +63,7 @@ Required properties: - brcm,int-map-mask: 32-bits bit mask describing how many and which interrupts are wired to this 2nd level interrupt controller, and how they match their respective interrupt parents. Should match exactly the number of interrupts - specified in the 'interrupts' property, multiplied by the number of - enable/status register pairs implemented by this controller. For - multiple parent IRQs with multiple enable/status words, this looks like: - <irq0_w0 irq0_w1 irq1_w0 irq1_w1 ...> + specified in the 'interrupts' property. Optional properties:
drivers/irqchip/irq-bcm7120-l2.c +67 -54
174 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH v4 7/16 irqchip: bcm7120-l2: Add support for BCM3380-style controllers
In reply to Kevin CernekeeThese controllers support multiple enable/status pairs (64+ IRQs), can put the enable/status words at different offsets, and do not support multiple parent IRQs.
--- .../interrupt-controller/brcm,bcm3380-l2-intc.txt | 41 ++++++++++++++++ drivers/irqchip/irq-bcm7120-l2.c | 57 ++++++++++++++++++++-- 2 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/brcm,bcm3380-l2-intc.txt
Documentation/devicetree/bindings/interrupt-controller/brcm,bcm3380-l2-intc.txt new file +41 -0
@@ -0,0 +1,41 @@ +Broadcom BCM3380-style Level 1 / Level 2 interrupt controller + +This interrupt controller shows up in various forms on many BCM338x/BCM63xx +chipsets. It has the following properties: + +- outputs a single interrupt signal to its interrupt controller parent + +- contains one or more enable/status word pairs, which often appear at + different offsets in different blocks + +- no atomic set/clear operations + +Required properties: + +- compatible: should be "brcm,bcm3380-l2-intc" +- reg: specifies one or more enable/status pairs, in the following format: + <enable_reg 0x4 status_reg 0x4>... +- interrupt-controller: identifies the node as an interrupt controller +- #interrupt-cells: specifies the number of cells needed to encode an interrupt + source, should be 1. +- interrupt-parent: specifies the phandle to the parent interrupt controller + this one is cascaded from +- interrupts: specifies the interrupt line in the interrupt-parent controller + node, valid values depend on the type of parent interrupt controller + +Optional properties: + +- brcm,irq-can-wake: if present, this means the L2 controller can be used as a + wakeup source for system suspend/resume. + +Example: + +irq0_intc: interrupt-controller@10000020 { + compatible = "brcm,bcm3380-l2-intc"; + reg = <0x10000024 0x4 0x1000002c 0x4>, + <0x10000020 0x4 0x10000028 0x4>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&cpu_intc>; + interrupts = <2>; +};
drivers/irqchip/irq-bcm7120-l2.c +52 -5
86 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH v4 8/16 irqchip: Add new driver for BCM7038-style level 1 interrupt controllers
In reply to Kevin CernekeeThis is the main peripheral IRQ controller on the BCM7xxx MIPS chips; it has the following characteristics:
- 64 to 160+ level IRQs
- Atomic set/clear registers
- Reasonably predictable register layout (N status words, then N mask status words, then N mask set words, then N mask clear words)
- SMP affinity supported on most systems
- Typically connected to MIPS IRQ 2,3,2,3 on CPUs 0,1,2,3
This driver registers one IRQ domain and one IRQ chip to cover all instances of the block. Up to 4 instances of the block may appear, as it supports 4-way IRQ affinity on BCM7435.
The same block exists on the ARM BCM7xxx chips, but typically the ARM GIC is used instead. So this driver is primarily intended for MIPS STB chips.
--- .../interrupt-controller/brcm,bcm7038-l1-intc.txt | 52 ++++ drivers/irqchip/Kconfig | 5 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-bcm7038-l1.c | 335 +++++++++++++++++++++ 4 files changed, 393 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/brcm,bcm7038-l1-intc.txt create mode 100644 drivers/irqchip/irq-bcm7038-l1.c
Documentation/devicetree/bindings/interrupt-controller/brcm,bcm7038-l1-intc.txt new file +52 -0
@@ -0,0 +1,52 @@ +Broadcom BCM7038-style Level 1 interrupt controller + +This block is a first level interrupt controller that is typically connected +directly to one of the HW INT lines on each CPU. Every BCM7xxx set-top chip +since BCM7038 has contained this hardware. + +Key elements of the hardware design include: + +- 64, 96, 128, or 160 incoming level IRQ lines + +- Most onchip peripherals are wired directly to an L1 input + +- A separate instance of the register set for each CPU, allowing individual + peripheral IRQs to be routed to any CPU + +- Atomic mask/unmask operations + +- No polarity/level/edge settings + +- No FIFO or priority encoder logic; software is expected to read all + 2-5 status words to determine which IRQs are pending + +Required properties: + +- compatible: should be "brcm,bcm7038-l1-intc" +- reg: specifies the base physical address and size of the registers; + the number of supported IRQs is inferred from the size argument +- interrupt-controller: identifies the node as an interrupt controller +- #interrupt-cells: specifies the number of cells needed to encode an interrupt + source, should be 1. +- interrupt-parent: specifies the phandle to the parent interrupt controller(s) + this one is cascaded from +- interrupts: specifies the interrupt line(s) in the interrupt-parent controller + node; valid values depend on the type of parent interrupt controller + +If multiple reg ranges and interrupt-parent entries are present on an SMP +system, the driver will allow IRQ SMP affinity to be set up through the +/proc/irq/ interface. In the simplest possible configuration, only one +reg range and one interrupt-parent is needed. + +Example: + +periph_intc: periph_intc@1041a400 { + compatible = "brcm,bcm7038-l1-intc"; + reg = <0x1041a400 0x30 0x1041a600 0x30>; + + interrupt-controller; + #interrupt-cells = <1>; + + interrupt-parent = <&cpu_intc>; + interrupts = <2>, <3>; +};
drivers/irqchip/Kconfig +5 -0
@@ -48,6 +48,11 @@ config ATMEL_AIC5_IRQ select MULTI_IRQ_HANDLER select SPARSE_IRQ +config BCM7038_L1_IRQ + bool + select GENERIC_IRQ_CHIP + select IRQ_DOMAIN + config BCM7120_L2_IRQ bool select GENERIC_IRQ_CHIP
drivers/irqchip/Makefile +1 -0
@@ -35,6 +35,7 @@ obj-$(CONFIG_TB10X_IRQC) += irq-tb10x.o obj-$(CONFIG_XTENSA) += irq-xtensa-pic.o obj-$(CONFIG_XTENSA_MX) += irq-xtensa-mx.o obj-$(CONFIG_IRQ_CROSSBAR) += irq-crossbar.o +obj-$(CONFIG_BCM7038_L1_IRQ) += irq-bcm7038-l1.o obj-$(CONFIG_BCM7120_L2_IRQ) += irq-bcm7120-l2.o obj-$(CONFIG_BRCMSTB_L2_IRQ) += irq-brcmstb-l2.o obj-$(CONFIG_KEYSTONE_IRQ) += irq-keystone.o
drivers/irqchip/irq-bcm7038-l1.c new file +335 -0
335 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH v4 9/16 MIPS: Let __dt_register_buses accept a single bus type
In reply to Kevin CernekeeSome machines only have one bus type to register (e.g. "simple-bus").
--- arch/mips/kernel/prom.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/mips/kernel/prom.c +4 -1
@@ -64,7 +64,10 @@ int __init __dt_register_buses(const char *bus0, const char *bus1)panic ("device tree not present" );strlcpy (of_ids[0 ].compatible, bus0,sizeof (of_ids[0 ].compatible)); -strlcpy (of_ids[1 ].compatible, bus1,sizeof (of_ids[1 ].compatible)); +if (bus1) { +strlcpy (of_ids[1 ].compatible, bus1, +sizeof (of_ids[1 ].compatible)); + }if (of_platform_populate (NULL , of_ids,NULL ,NULL ))panic ("failed to populate DT" );
Signature · 1 line
2.1.0
PATCH v4 10/16 MIPS: Fall back to the generic restart notifier
In reply to Kevin CernekeeIf the machine doesn't set its own _machine_restart callback, call the common do_kernel_restart() instead. This allows arch-independent reset drivers from drivers/power/reset/ to be used to reboot the machine.
--- arch/mips/kernel/reset.c | 2 ++ 1 file changed, 2 insertions(+)
arch/mips/kernel/reset.c +2 -0
@@ -29,6 +29,8 @@ void machine_restart(char *command) {if (_machine_restart)_machine_restart (command); +else +do_kernel_restart (command); }void machine_halt (void )
Signature · 1 line
2.1.0
PATCH v4 11/16 MIPS: Reorder MIPS_L1_CACHE_SHIFT priorities
In reply to Kevin CernekeeEnabling support for more than one BMIPS CPU in the same build may result in different L1_CACHE_SHIFT values, e.g.
CPU_BMIPS5000 selects MIPS_L1_CACHE_SHIFT_7
CPU_BMIPS4380 selects MIPS_L1_CACHE_SHIFT_6
anything else defaults to MIPS_L1_CACHE_SHIFT_5Ensure that if more than one MIPS_L1_CACHE_SHIFT_x option is selected, Kconfig sets CONFIG_MIPS_L1_CACHE_SHIFT to the highest value.
--- arch/mips/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/mips/Kconfig +3 -3
@@ -1167,10 +1167,10 @@ config MIPS_L1_CACHE_SHIFT_7 config MIPS_L1_CACHE_SHIFT int - default "4" if MIPS_L1_CACHE_SHIFT_4 - default "5" if MIPS_L1_CACHE_SHIFT_5 - default "6" if MIPS_L1_CACHE_SHIFT_6 default "7" if MIPS_L1_CACHE_SHIFT_7 + default "6" if MIPS_L1_CACHE_SHIFT_6 + default "5" if MIPS_L1_CACHE_SHIFT_5 + default "4" if MIPS_L1_CACHE_SHIFT_4 default "5" config HAVE_STD_PC_SERIAL_PORT
Signature · 1 line
2.1.0
PATCH v4 12/16 MIPS: Create a common <asm/mach-generic/war.h>
In reply to Kevin Cernekee11 platforms require at least one of these workarounds to be enabled; 22 platforms do not. In the latter case we can fall back to a generic version.
Note that this also deletes an orphaned reference to RM9000_CDEX_SMP_WAR.
--- arch/mips/include/asm/mach-ar7/war.h | 24 ------------------------ arch/mips/include/asm/mach-ath25/war.h | 25 ------------------------- arch/mips/include/asm/mach-ath79/war.h | 24 ------------------------ arch/mips/include/asm/mach-au1x00/war.h | 24 ------------------------ arch/mips/include/asm/mach-bcm47xx/war.h | 24 ------------------------ arch/mips/include/asm/mach-bcm63xx/war.h | 24 ------------------------ arch/mips/include/asm/mach-cavium-octeon/war.h | 25 ------------------------- arch/mips/include/asm/mach-cobalt/war.h | 24 ------------------------ arch/mips/include/asm/mach-dec/war.h | 24 ------------------------ arch/mips/include/asm/mach-emma2rh/war.h | 24 ------------------------ arch/mips/include/asm/mach-generic/war.h | 24 ++++++++++++++++++++++++ arch/mips/include/asm/mach-jazz/war.h | 24 ------------------------ arch/mips/include/asm/mach-jz4740/war.h | 24 ------------------------ arch/mips/include/asm/mach-lantiq/war.h | 23 ----------------------- arch/mips/include/asm/mach-lasat/war.h | 24 ------------------------ arch/mips/include/asm/mach-loongson/war.h | 24 ------------------------ arch/mips/include/asm/mach-loongson1/war.h | 24 ------------------------ arch/mips/include/asm/mach-netlogic/war.h | 25 ------------------------- arch/mips/include/asm/mach-paravirt/war.h | 25 ------------------------- arch/mips/include/asm/mach-pnx833x/war.h | 24 ------------------------ arch/mips/include/asm/mach-ralink/war.h | 24 ------------------------ arch/mips/include/asm/mach-tx39xx/war.h | 24 ------------------------ arch/mips/include/asm/mach-vr41xx/war.h | 24 ------------------------ 23 files changed, 24 insertions(+), 531 deletions(-) delete mode 100644 arch/mips/include/asm/mach-ar7/war.h delete mode 100644 arch/mips/include/asm/mach-ath25/war.h delete mode 100644 arch/mips/include/asm/mach-ath79/war.h delete mode 100644 arch/mips/include/asm/mach-au1x00/war.h delete mode 100644 arch/mips/include/asm/mach-bcm47xx/war.h delete mode 100644 arch/mips/include/asm/mach-bcm63xx/war.h delete mode 100644 arch/mips/include/asm/mach-cavium-octeon/war.h delete mode 100644 arch/mips/include/asm/mach-cobalt/war.h delete mode 100644 arch/mips/include/asm/mach-dec/war.h delete mode 100644 arch/mips/include/asm/mach-emma2rh/war.h create mode 100644 arch/mips/include/asm/mach-generic/war.h delete mode 100644 arch/mips/include/asm/mach-jazz/war.h delete mode 100644 arch/mips/include/asm/mach-jz4740/war.h delete mode 100644 arch/mips/include/asm/mach-lantiq/war.h delete mode 100644 arch/mips/include/asm/mach-lasat/war.h delete mode 100644 arch/mips/include/asm/mach-loongson/war.h delete mode 100644 arch/mips/include/asm/mach-loongson1/war.h delete mode 100644 arch/mips/include/asm/mach-netlogic/war.h delete mode 100644 arch/mips/include/asm/mach-paravirt/war.h delete mode 100644 arch/mips/include/asm/mach-pnx833x/war.h delete mode 100644 arch/mips/include/asm/mach-ralink/war.h delete mode 100644 arch/mips/include/asm/mach-tx39xx/war.h delete mode 100644 arch/mips/include/asm/mach-vr41xx/war.h
arch/mips/include/asm/mach-ar7/war.h deleted +0 -0
arch/mips/include/asm/mach-ath25/war.h deleted +0 -0
arch/mips/include/asm/mach-ath79/war.h deleted +0 -0
arch/mips/include/asm/mach-au1x00/war.h deleted +0 -0
arch/mips/include/asm/mach-bcm47xx/war.h deleted +0 -0
arch/mips/include/asm/mach-bcm63xx/war.h deleted +0 -0
arch/mips/include/asm/mach-cavium-octeon/war.h deleted +0 -0
arch/mips/include/asm/mach-cobalt/war.h deleted +0 -0
arch/mips/include/asm/mach-dec/war.h deleted +0 -0
arch/mips/include/asm/mach-emma2rh/war.h deleted +0 -0
arch/mips/include/asm/mach-generic/war.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. +* +* Copyright (C) 2002, 2004, 2007 by Ralf Baechle <[email protected]> +*/ +#ifndef __ASM_MACH_GENERIC_WAR_H +#define __ASM_MACH_GENERIC_WAR_H + +#define R4600_V1_INDEX_ICACHEOP_WAR 0 +#define R4600_V1_HIT_CACHEOP_WAR 0 +#define R4600_V2_HIT_CACHEOP_WAR 0 +#define R5432_CP0_INTERRUPT_WAR 0 +#define BCM1250_M3_WAR 0 +#define SIBYTE_1956_WAR 0 +#define MIPS4K_ICACHE_REFILL_WAR 0 +#define MIPS_CACHE_SYNC_WAR 0 +#define TX49XX_ICACHE_INDEX_INV_WAR 0 +#define ICACHE_REFILLS_WORKAROUND_WAR 0 +#define R10000_LLSC_WAR 0 +#define MIPS34K_MISSED_ITLB_WAR 0 + +#endif /* __ASM_MACH_GENERIC_WAR_H */
arch/mips/include/asm/mach-jazz/war.h deleted +0 -0
arch/mips/include/asm/mach-jz4740/war.h deleted +0 -0
arch/mips/include/asm/mach-lantiq/war.h deleted +0 -0
arch/mips/include/asm/mach-lasat/war.h deleted +0 -0
arch/mips/include/asm/mach-loongson/war.h deleted +0 -0
arch/mips/include/asm/mach-loongson1/war.h deleted +0 -0
arch/mips/include/asm/mach-netlogic/war.h deleted +0 -0
arch/mips/include/asm/mach-paravirt/war.h deleted +0 -0
arch/mips/include/asm/mach-pnx833x/war.h deleted +0 -0
arch/mips/include/asm/mach-ralink/war.h deleted +0 -0
arch/mips/include/asm/mach-tx39xx/war.h deleted +0 -0
arch/mips/include/asm/mach-vr41xx/war.h deleted +0 -0
Signature · 1 line
2.1.0
PATCH v4 13/16 MIPS: BMIPS: Flush the readahead cache after DMA
In reply to Kevin CernekeeBMIPS 3300/435x/438x CPUs have a readahead cache that is separate from the L1/L2. During a DMA operation, accesses adjacent to a DMA buffer may cause parts of the DMA buffer to be prefetched into the RAC. To avoid possible coherency problems, flush the RAC upon DMA completion.
--- arch/mips/mm/dma-default.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
arch/mips/mm/dma-default.c +13 -0
@@ -18,6 +18,7 @@#include <linux/highmem.h> #include <linux/dma-contiguous.h> +#include <asm/bmips.h> #include <asm/cache.h> #include <asm/cpu-type.h> #include <asm/io.h>
@@ -69,6 +70,18 @@ static inline struct page *dma_addr_to_page(struct device *dev,*/ static inline int cpu_needs_post_dma_flush (struct device *dev) { +if (boot_cpu_type () ==CPU_BMIPS3300 || +boot_cpu_type () ==CPU_BMIPS4350 || +boot_cpu_type () ==CPU_BMIPS4380 ) { +void __iomem *cbr =BMIPS_GET_CBR (); + +/* Flush stale data out of the readahead cache */ +__raw_writel (0x100 , cbr +BMIPS_RAC_CONFIG ); +__raw_readl (cbr +BMIPS_RAC_CONFIG ); + +return 0 ; + } + return !plat_device_is_coherent(dev) && (boot_cpu_type() == CPU_R10000 || boot_cpu_type() == CPU_R12000 ||
Signature · 1 line
2.1.0
PATCH v4 14/16 MIPS: BMIPS: Document the firmware->kernel DTB interface
In reply to Kevin CernekeeAdd a new section covering the Generic BMIPS machine type.
--- Documentation/devicetree/booting-without-of.txt | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
Documentation/devicetree/booting-without-of.txt +28 -0
@@ -15,6 +15,7 @@ Table of Contents 1) Entry point for arch/arm 2) Entry point for arch/powerpc 3) Entry point for arch/x86 + 4) Entry point for arch/mips/bmips II - The DT block format 1) Header
@@ -288,6 +289,33 @@ it with special cases. or initrd address. It simply holds information which can not be retrieved otherwise like interrupt routing or a list of devices behind an I2C bus. +4) Entry point for arch/mips/bmips +---------------------------------- + + Some bootloaders only support a single entry point, at the start of the + kernel image. Other bootloaders will jump to the ELF start address. + Both schemes are supported; CONFIG_BOOT_RAW=y and CONFIG_NO_EXCEPT_FILL=y, + so the first instruction immediately jumps to kernel_entry(). + + Similar to the arch/arm case (b), a DT-aware bootloader is expected to + set up the following registers: + + a0 : 0 + + a1 : 0xffffffff + + a2 : Physical pointer to the device tree block (defined in chapter + II) in RAM. The device tree can be located anywhere in the first + 512MB of the physical address space (0x00000000 - 0x1fffffff), + aligned on a 64 bit boundary. + + Legacy bootloaders do not use this convention, and they do not pass in a + DT block. In this case, Linux will look for a builtin DTB, selected via + CONFIG_DT_*. + + This convention is defined for 32-bit systems only, as there are not + currently any 64-bit BMIPS implementations. + II - The DT block format ========================
Signature · 1 line
2.1.0
PATCH v4 15/16 MIPS: Add Generic BMIPS target
In reply to Kevin Cernekeebmips_be_defconfig supports Linux running on the following CM and DSL SoCs:
- BCM3384 (BMIPS5000) cable modem application processor, BE, SMP
- BCM3384 (BMIPS4355) cable modem "spare CPU"*, BE
- BCM6328 (BMIPS4355) ADSL chip, BE
- BCM6368 (BMIPS4350) ADSL chip, BE, SMP
*experimental; most configurations will require changing CONFIG_PHYSICAL_START
bmips_stb_defconfig supports Linux running on the (nominally LE) STB chipsets:
- BCM7125 (BMIPS4380) set-top box chip, LE, SMP
- BCM7346 (BMIPS5000) set-top box chip, LE, SMP
- BCM7360 (BMIPS3300) set-top box chip, LE
- BCM7420 (BMIPS5000) set-top box chip, LE, SMP
- BCM7425 (BMIPS5000) set-top box chip, LE, SMP
serial8250 and bcm63xx_uart do not currently coexist. If/when this is fixed, it will be also possible to boot the BE image on any supported STB board configured for BE. For now, each defconfig can only pick one UART driver, and the BE defconfig enables bcm63xx_uart.
On these MIPS systems, endianness cannot be reconfigured at runtime. On STB it is sometimes offered as a board jumper or 0-ohm resistor, and sometimes hardwired to LE only. The CM and DSL systems always run BE.
Device Tree is used to configure the following items:
- UART, USB, GENET peripherals
- IRQ controllers
- Early console base address (bcm63xx_uart only)
- SMP or UP mode
- MIPS counter frequency
- Memory size / regions
- DMA remappings
- Reboot sequences
- GISB bus error catcher
- Kernel command line
The DT-enabled bootloader and build instructions for 3384 are posted at
https://github.com/Broadcom/aeolus .
--- .../devicetree/bindings/mips/brcm/bmips.txt | 8 + .../devicetree/bindings/mips/brcm/soc.txt | 12 ++ arch/mips/Kbuild.platforms | 1 + arch/mips/Kconfig | 34 ++++ arch/mips/bmips/Makefile | 1 + arch/mips/bmips/Platform | 7 + arch/mips/bmips/dma.c | 121 +++++++++++++ arch/mips/bmips/irq.c | 38 ++++ arch/mips/bmips/setup.c | 191 +++++++++++++++++++++ arch/mips/configs/bmips_be_defconfig | 88 ++++++++++ arch/mips/configs/bmips_stb_defconfig | 88 ++++++++++ arch/mips/include/asm/mach-bmips/dma-coherence.h | 48 ++++++ arch/mips/include/asm/mach-bmips/spaces.h | 18 ++ 13 files changed, 655 insertions(+) create mode 100644 Documentation/devicetree/bindings/mips/brcm/bmips.txt create mode 100644 Documentation/devicetree/bindings/mips/brcm/soc.txt create mode 100644 arch/mips/bmips/Makefile create mode 100644 arch/mips/bmips/Platform create mode 100644 arch/mips/bmips/dma.c create mode 100644 arch/mips/bmips/irq.c create mode 100644 arch/mips/bmips/setup.c create mode 100644 arch/mips/configs/bmips_be_defconfig create mode 100644 arch/mips/configs/bmips_stb_defconfig create mode 100644 arch/mips/include/asm/mach-bmips/dma-coherence.h create mode 100644 arch/mips/include/asm/mach-bmips/spaces.h
Documentation/devicetree/bindings/mips/brcm/bmips.txt new file +8 -0
@@ -0,0 +1,8 @@ +* Broadcom MIPS (BMIPS) CPUs + +Required properties: +- compatible: "brcm,bmips3300", "brcm,bmips4350", "brcm,bmips4380" + "brcm,bmips5000" + +- mips-hpt-frequency: This is common to all CPUs in the system so it lives + under the "cpus" node.
Documentation/devicetree/bindings/mips/brcm/soc.txt new file +12 -0
@@ -0,0 +1,12 @@ +* Broadcom cable/DSL/settop platforms + +Required properties: + +- compatible: "brcm,bcm3384", "brcm,bcm33843" + "brcm,bcm3384-viper", "brcm,bcm33843-viper" + "brcm,bcm6328", "brcm,bcm6368", + "brcm,bcm7125", "brcm,bcm7346", "brcm,bcm7360", + "brcm,bcm7420", "brcm,bcm7425" + +The experimental -viper variants are for running Linux on the 3384's +BMIPS4355 cable modem CPU instead of the BMIPS5000 application processor.
arch/mips/Kbuild.platforms +1 -0
@@ -6,6 +6,7 @@ platforms += ath25 platforms += ath79 platforms += bcm47xx platforms += bcm63xx +platforms += bmips platforms += cavium-octeon platforms += cobalt platforms += dec
arch/mips/Kconfig +34 -0
@@ -130,6 +130,40 @@ config ATH79 help Support for the Atheros AR71XX/AR724X/AR913X SoCs. +config BMIPS_GENERIC + bool "Broadcom Generic BMIPS kernel" + select BOOT_RAW + select NO_EXCEPT_FILL + select USE_OF + 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 if CPU_BIG_ENDIAN + select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN + select USB_OHCI_BIG_ENDIAN_DESC if CPU_BIG_ENDIAN + select USB_OHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN + help + Build a generic DT-based kernel image that boots on select + BCM33xx cable modem chips, BCM63xx DSL chips, and BCM7xxx set-top + box chips. Note that CONFIG_CPU_BIG_ENDIAN/CONFIG_CPU_LITTLE_ENDIAN + must be set appropriately for your board. + config BCM47XX bool "Broadcom BCM47XX based boards" select ARCH_WANT_OPTIONAL_GPIOLIB
arch/mips/bmips/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-y += setup.o irq.o dma.o
arch/mips/bmips/Platform new file +7 -0
@@ -0,0 +1,7 @@ +# +# Broadcom Generic BMIPS kernel +# +platform-$(CONFIG_BMIPS_GENERIC) += bmips/ +cflags-$(CONFIG_BMIPS_GENERIC) += \ + -I$(srctree)/arch/mips/include/asm/mach-bmips/ +load-$(CONFIG_BMIPS_GENERIC) := 0xffffffff80010000
arch/mips/bmips/dma.c new file +121 -0
121 lines not on this page · raw message
arch/mips/bmips/irq.c new file +38 -0
@@ -0,0 +1,38 @@ +/* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published +* by the Free Software Foundation. +* +* Copyright (C) 2014 Broadcom Corporation +* Author: Kevin Cernekee <[email protected]> +*/ + +#include <linux/of.h> +#include <linux/irqchip.h> + +#include <asm/bmips.h> +#include <asm/irq.h> +#include <asm/irq_cpu.h> +#include <asm/time.h> + +unsigned int get_c0_compare_int (void ) +{ +return CP0_LEGACY_COMPARE_IRQ ; +} + +void __init arch_init_irq (void ) +{ +struct device_node *dn; + +/* Only the STB (bcm7038) controller supports SMP IRQ affinity */ + dn =of_find_compatible_node (NULL ,NULL ,"brcm,bcm7038-l1-intc" ); +if (dn) +of_node_put (dn); +else + bmips_tp1_irqs =0 ; + +irqchip_init (); +} + +OF_DECLARE_2 (irqchip, mips_cpu_intc,"mti,cpu-interrupt-controller" , + mips_cpu_irq_of_init);
arch/mips/bmips/setup.c new file +191 -0
191 lines not on this page · raw message
arch/mips/configs/bmips_be_defconfig new file +88 -0
88 lines not on this page · raw message
arch/mips/configs/bmips_stb_defconfig new file +88 -0
88 lines not on this page · raw message
arch/mips/include/asm/mach-bmips/dma-coherence.h new file +48 -0
48 lines not on this page · raw message
arch/mips/include/asm/mach-bmips/spaces.h new file +18 -0
@@ -0,0 +1,18 @@ +/* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. +* +* Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle +* Copyright (C) 2000, 2002 Maciej W. Rozycki +* Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc. +*/ +#ifndef _ASM_BMIPS_SPACES_H +#define _ASM_BMIPS_SPACES_H + +/* Avoid collisions with system base register (SBR) region on BMIPS3300 */ +#define FIXADDR_TOP ((unsigned long)(long)(int)0xff000000) + +#include <asm/mach-generic/spaces.h> + +#endif /* __ASM_BMIPS_SPACES_H */
Signature · 1 line
2.1.0
PATCH v4 16/16 MIPS: BMIPS: Add DTS files for several platforms
In reply to Kevin CernekeeMost of the supported chips use legacy (non-DT) bootloaders, so they will need to select an appropriate builtin DTB at compile time until the bootloader is updated. Provide suitable DTS files, and a means to compile one of them into the kernel image.
--- arch/mips/Kconfig | 1 + arch/mips/bmips/Kconfig | 50 +++++++ arch/mips/boot/dts/Makefile | 9 ++ arch/mips/boot/dts/bcm3384_viper.dtsi | 108 +++++++++++++++ arch/mips/boot/dts/bcm3384_zephyr.dtsi | 126 +++++++++++++++++ arch/mips/boot/dts/bcm6328.dtsi | 86 ++++++++++++ arch/mips/boot/dts/bcm6368.dtsi | 93 +++++++++++++ arch/mips/boot/dts/bcm7125.dtsi | 139 +++++++++++++++++++ arch/mips/boot/dts/bcm7346.dtsi | 224 ++++++++++++++++++++++++++++++ arch/mips/boot/dts/bcm7360.dtsi | 161 ++++++++++++++++++++++ arch/mips/boot/dts/bcm7420.dtsi | 184 +++++++++++++++++++++++++ arch/mips/boot/dts/bcm7425.dtsi | 225 +++++++++++++++++++++++++++++++ arch/mips/boot/dts/bcm93384wvg.dts | 25 ++++ arch/mips/boot/dts/bcm93384wvg_viper.dts | 25 ++++ arch/mips/boot/dts/bcm96368mvwg.dts | 31 +++++ arch/mips/boot/dts/bcm97125cbmb.dts | 31 +++++ arch/mips/boot/dts/bcm97346dbsmb.dts | 58 ++++++++ arch/mips/boot/dts/bcm97360svmb.dts | 34 +++++ arch/mips/boot/dts/bcm97420c.dts | 45 +++++++ arch/mips/boot/dts/bcm97425svmb.dts | 60 +++++++++ arch/mips/boot/dts/bcm9ejtagprb.dts | 22 +++ 21 files changed, 1737 insertions(+) create mode 100644 arch/mips/bmips/Kconfig create mode 100644 arch/mips/boot/dts/bcm3384_viper.dtsi create mode 100644 arch/mips/boot/dts/bcm3384_zephyr.dtsi create mode 100644 arch/mips/boot/dts/bcm6328.dtsi create mode 100644 arch/mips/boot/dts/bcm6368.dtsi create mode 100644 arch/mips/boot/dts/bcm7125.dtsi create mode 100644 arch/mips/boot/dts/bcm7346.dtsi create mode 100644 arch/mips/boot/dts/bcm7360.dtsi create mode 100644 arch/mips/boot/dts/bcm7420.dtsi create mode 100644 arch/mips/boot/dts/bcm7425.dtsi create mode 100644 arch/mips/boot/dts/bcm93384wvg.dts create mode 100644 arch/mips/boot/dts/bcm93384wvg_viper.dts create mode 100644 arch/mips/boot/dts/bcm96368mvwg.dts create mode 100644 arch/mips/boot/dts/bcm97125cbmb.dts create mode 100644 arch/mips/boot/dts/bcm97346dbsmb.dts create mode 100644 arch/mips/boot/dts/bcm97360svmb.dts create mode 100644 arch/mips/boot/dts/bcm97420c.dts create mode 100644 arch/mips/boot/dts/bcm97425svmb.dts create mode 100644 arch/mips/boot/dts/bcm9ejtagprb.dts
arch/mips/Kconfig +1 -0
@@ -892,6 +892,7 @@ source "arch/mips/ath25/Kconfig" source "arch/mips/ath79/Kconfig" source "arch/mips/bcm47xx/Kconfig" source "arch/mips/bcm63xx/Kconfig" +source "arch/mips/bmips/Kconfig" source "arch/mips/jazz/Kconfig" source "arch/mips/jz4740/Kconfig" source "arch/mips/lantiq/Kconfig"
arch/mips/bmips/Kconfig new file +50 -0
50 lines not on this page · raw message
arch/mips/boot/dts/Makefile +9 -0
@@ -1,4 +1,13 @@ dtb-$(CONFIG_CAVIUM_OCTEON_SOC) += octeon_3xxx.dtb octeon_68xx.dtb +dtb-$(CONFIG_DT_BCM93384WVG) += bcm93384wvg.dtb +dtb-$(CONFIG_DT_BCM93384WVG_VIPER) += bcm93384wvg_viper.dtb +dtb-$(CONFIG_DT_BCM96368MVWG) += bcm96368mvwg.dtb +dtb-$(CONFIG_DT_BCM9EJTAGPRB) += bcm9ejtagprb.dtb +dtb-$(CONFIG_DT_BCM97125CBMB) += bcm97125cbmb.dtb +dtb-$(CONFIG_DT_BCM97346DBSMB) += bcm97346dbsmb.dtb +dtb-$(CONFIG_DT_BCM97360SVMB) += bcm97360svmb.dtb +dtb-$(CONFIG_DT_BCM97420C) += bcm97420c.dtb +dtb-$(CONFIG_DT_BCM97425SVMB) += bcm97425svmb.dtb dtb-$(CONFIG_DT_EASY50712) += easy50712.dtb dtb-$(CONFIG_DT_XLP_EVP) += xlp_evp.dtb dtb-$(CONFIG_DT_XLP_SVP) += xlp_svp.dtb
arch/mips/boot/dts/bcm3384_viper.dtsi new file +108 -0
108 lines not on this page · raw message
arch/mips/boot/dts/bcm3384_zephyr.dtsi new file +126 -0
126 lines not on this page · raw message
arch/mips/boot/dts/bcm6328.dtsi new file +86 -0
86 lines not on this page · raw message
arch/mips/boot/dts/bcm6368.dtsi new file +93 -0
93 lines not on this page · raw message
arch/mips/boot/dts/bcm7125.dtsi new file +139 -0
139 lines not on this page · raw message
arch/mips/boot/dts/bcm7346.dtsi new file +224 -0
224 lines not on this page · raw message
arch/mips/boot/dts/bcm7360.dtsi new file +161 -0
161 lines not on this page · raw message
arch/mips/boot/dts/bcm7420.dtsi new file +184 -0
184 lines not on this page · raw message
arch/mips/boot/dts/bcm7425.dtsi new file +225 -0
225 lines not on this page · raw message
arch/mips/boot/dts/bcm93384wvg.dts new file +25 -0
@@ -0,0 +1,25 @@ +/dts-v1/; + +/include/ "bcm3384_zephyr.dtsi" + +/ { + compatible = "brcm,bcm93384wvg", "brcm,bcm3384"; + model = "Broadcom BCM93384WVG"; + + chosen { + bootargs = "console=ttyS0,115200"; + stdout-path = &uart0; + }; +}; + +&uart0 { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ohci0 { + status = "okay"; +};
arch/mips/boot/dts/bcm93384wvg_viper.dts new file +25 -0
@@ -0,0 +1,25 @@ +/dts-v1/; + +/include/ "bcm3384_viper.dtsi" + +/ { + compatible = "brcm,bcm93384wvg-viper", "brcm,bcm3384-viper"; + model = "Broadcom BCM93384WVG-viper"; + + chosen { + bootargs = "console=ttyS0,115200"; + stdout-path = &uart0; + }; +}; + +&uart0 { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ohci0 { + status = "okay"; +};
arch/mips/boot/dts/bcm96368mvwg.dts new file +31 -0
@@ -0,0 +1,31 @@ +/dts-v1/; + +/include/ "bcm6368.dtsi" + +/ { + compatible = "brcm,bcm96368mvwg", "brcm,bcm6368"; + model = "Broadcom BCM96368MVWG"; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x04000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + stdout-path = &uart0; + }; +}; + +&uart0 { + status = "okay"; +}; + +/* FIXME: need to set up USB_CTRL registers first */ +&ehci0 { + status = "disabled"; +}; + +&ohci0 { + status = "disabled"; +};
arch/mips/boot/dts/bcm97125cbmb.dts new file +31 -0
@@ -0,0 +1,31 @@ +/dts-v1/; + +/include/ "bcm7125.dtsi" + +/ { + compatible = "brcm,bcm97125cbmb", "brcm,bcm7125"; + model = "Broadcom BCM97125CBMB"; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + stdout-path = &uart0; + }; +}; + +&uart0 { + status = "okay"; +}; + +/* FIXME: USB is wonky; disable it for now */ +&ehci0 { + status = "disabled"; +}; + +&ohci0 { + status = "disabled"; +};
arch/mips/boot/dts/bcm97346dbsmb.dts new file +58 -0
58 lines not on this page · raw message
arch/mips/boot/dts/bcm97360svmb.dts new file +34 -0
@@ -0,0 +1,34 @@ +/dts-v1/; + +/include/ "bcm7360.dtsi" + +/ { + compatible = "brcm,bcm97360svmb", "brcm,bcm7360"; + model = "Broadcom BCM97360SVMB"; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + stdout-path = &uart0; + }; +}; + +&uart0 { + status = "okay"; +}; + +&enet0 { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ohci0 { + status = "okay"; +};
arch/mips/boot/dts/bcm97420c.dts new file +45 -0
45 lines not on this page · raw message
arch/mips/boot/dts/bcm97425svmb.dts new file +60 -0
60 lines not on this page · raw message
arch/mips/boot/dts/bcm9ejtagprb.dts new file +22 -0
@@ -0,0 +1,22 @@ +/dts-v1/; + +/include/ "bcm6328.dtsi" + +/ { + compatible = "brcm,bcm9ejtagprb", "brcm,bcm6328"; + model = "Broadcom BCM9EJTAGPRB"; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x08000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + stdout-path = &uart0; + }; +}; + +&uart0 { + status = "okay"; +};
Signature · 1 line
2.1.0
Re: [PATCH V4 08/16] irqchip: Add new driver for BCM7038-style level 1 interrupt controllers
In reply to Kevin CernekeeQuoted 55 lines · Kevin Cernekee
This is the main peripheral IRQ controller on the BCM7xxx MIPS chips; it has the following characteristics:
- 64 to 160+ level IRQs
- Atomic set/clear registers
- Reasonably predictable register layout (N status words, then N mask status words, then N mask set words, then N mask clear words)
- SMP affinity supported on most systems
- Typically connected to MIPS IRQ 2,3,2,3 on CPUs 0,1,2,3This driver registers one IRQ domain and one IRQ chip to cover all instances of the block. Up to 4 instances of the block may appear, as it supports 4-way IRQ affinity on BCM7435.
The same block exists on the ARM BCM7xxx chips, but typically the ARM GIC is used instead. So this driver is primarily intended for MIPS STB chips.
Signed-off-by Kevin Cernekee <[email protected]>--- .../interrupt-controller/brcm,bcm7038-l1-intc.txt | 52 ++++ drivers/irqchip/Kconfig | 5 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-bcm7038-l1.c | 335 +++++++++++++++++++++ 4 files changed, 393 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/brcm,bcm7038-l1-intc.txt create mode 100644 drivers/irqchip/irq-bcm7038-l1.cDocumentation/devicetree/bindings/interrupt-controller/brcm,bcm7038-l1-intc.txt new file +22
-0@@ -0,0 +1,52 @@ +Broadcom BCM7038-style Level 1 interrupt controller + +This block is a first level interrupt controller that is typically connected +directly to one of the HW INT lines on each CPU. Every BCM7xxx set-top chip +since BCM7038 has contained this hardware. + +Key elements of the hardware design include: + +- 64, 96, 128, or 160 incoming level IRQ lines + +- Most onchip peripherals are wired directly to an L1 input + +- A separate instance of the register set for each CPU, allowing individual + peripheral IRQs to be routed to any CPU + +- Atomic mask/unmask operations + +- No polarity/level/edge settings + +- No FIFO or priority encoder logic; software is expected to read all + 2-5 status words to determine which IRQs are pending +
Documentation/devicetree/bindings/interrupt-controller/brcm,bcm7038-l1-intc.txt line 32
Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/brcm,bcm7038-l1-intc.txt new file +10
-0+Required properties: + +- compatible: should be "brcm,bcm7038-l1-intc" +- reg: specifies the base physical address and size of the registers; + the number of supported IRQs is inferred from the size argument +- interrupt-controller: identifies the node as an interrupt controller +- #interrupt-cells: specifies the number of cells needed to encode an interrupt + source, should be 1. +- interrupt-parent: specifies the phandle to the parent interrupt controller(s) + this one is cascaded from
I'm not that firm in interrupt controller terminology, but can this be a level 1 interrupt controller if it has a parent interrupt controller? Isn't the parent the level 1 interrupt controller? Or would the parent then be a level 0 interrupt controller? ;-)
Regards,
Jonas
Re: [PATCH V4 08/16] irqchip: Add new driver for BCM7038-style level 1 interrupt controllers
Quoted 4 lines · Jonas Gorski
I'm not that firm in interrupt controller terminology, but can this be a level 1 interrupt controller if it has a parent interrupt controller? Isn't the parent the level 1 interrupt controller? Or would the parent then be a level 0 interrupt controller? ;-)
According to the register manual, this is an L1 controller and the "IRQ0" controller handled by irq-bcm7120-l2.c is an L2 controller.
This terminology is used consistently across the MIPS and ARM STB chips, but it is worth noting that MIPS has a builtin "L0 controller" (not a published term) to demux the 5 HW IRQ lines, while ARM only uses a single IRQ input for peripherals. On STB MIPS platforms it is typical to only use one HW IRQ input per CPU (TP).
Also note that brcm,bcm3384-l2-intc can either be used for an L1 (PERIPH INT block) or an L2/L3 (ZMIPS/CMIPS/IOP).
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html