Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH 0/8] MIPS: BCM63XX: remove !RUNTIME_DETECT support
@ 2014-07-08 14:53 Jonas Gorski
  2014-07-08 14:53 ` [PATCH 1/8] MIPS: BCM63XX: remove !RUNTIME_DETECT code from register sets Jonas Gorski
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Jonas Gorski @ 2014-07-08 14:53 UTC (permalink / raw)
  To: linux-mips
  Cc: Ralf Baechle, John Crispin, Maxime Bizon, Florian Fainelli,
	Kevin Cernekee

The advantages compared to the added maintaince burden of ensuring
that changes don't break the single-soc support with !RUNTIME_DETECT
are rather small, so remove it.

The only place where it might have any impact might be the irq code.
But even then replacing it with UASM might be a better choice, as it
would then profit all targets.

P.S: there is a small lie in 7/8, but since BCM6318 support isn't
yet upstream, it is valid for the current code. BCM6318 has only
a BCM3300 CPU, but it does have dc aliases (at least according to
the bootlog).

Jonas Gorski (8):
  MIPS: BCM63XX: remove !RUNTIME_DETECT code from register sets
  MIPS: BCM63XX: remove !RUNTIME_DETECT from irq setup code
  MIPS: BCM63XX: remove !RUNTIME_DETECT from reset code
  MIPS: BCM63XX: remove !RUNTIME_DETECT code from gpio code
  MIPS: BCM63XX: remove !RUNTIME_DETECT from spi code
  MIPS: BCM63XX: remove !RUNTIME_DETECT usage from enet code
  MIPS: BCM63XX: remove !RUNTIME_DETECT in cpu-feature-overrides
  MIPS: BCM63XX: remove !RUNTIME_DETECT code for bcmcpu_get_id

 arch/mips/bcm63xx/cpu.c                            |  11 +-
 arch/mips/bcm63xx/dev-enet.c                       |   4 -
 arch/mips/bcm63xx/dev-spi.c                        |   4 -
 arch/mips/bcm63xx/gpio.c                           |  14 --
 arch/mips/bcm63xx/irq.c                            | 109 ------------
 arch/mips/bcm63xx/reset.c                          |  60 -------
 arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h   | 198 ++++-----------------
 .../include/asm/mach-bcm63xx/bcm63xx_dev_enet.h    |  46 -----
 .../include/asm/mach-bcm63xx/bcm63xx_dev_spi.h     |  31 ----
 .../asm/mach-bcm63xx/cpu-feature-overrides.h       |   2 +-
 10 files changed, 39 insertions(+), 440 deletions(-)

-- 
2.0.0

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/8] MIPS: BCM63XX: remove !RUNTIME_DETECT code from register sets
  2014-07-08 14:53 [PATCH 0/8] MIPS: BCM63XX: remove !RUNTIME_DETECT support Jonas Gorski
@ 2014-07-08 14:53 ` Jonas Gorski
  2014-07-08 14:53 ` [PATCH 2/8] MIPS: BCM63XX: remove !RUNTIME_DETECT from irq setup code Jonas Gorski
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Jonas Gorski @ 2014-07-08 14:53 UTC (permalink / raw)
  To: linux-mips
  Cc: Ralf Baechle, John Crispin, Maxime Bizon, Florian Fainelli,
	Kevin Cernekee

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
---
 arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h | 78 ------------------------
 1 file changed, 78 deletions(-)

diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
index 3112f08..4d76fc7 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
@@ -598,55 +598,6 @@ enum bcm63xx_regs_set {
 
 extern const unsigned long *bcm63xx_regs_base;
 
-#define __GEN_RSET_BASE(__cpu, __rset)					\
-	case RSET_## __rset :						\
-		return BCM_## __cpu ##_## __rset ##_BASE;
-
-#define __GEN_RSET(__cpu)						\
-	switch (set) {							\
-	__GEN_RSET_BASE(__cpu, DSL_LMEM)				\
-	__GEN_RSET_BASE(__cpu, PERF)					\
-	__GEN_RSET_BASE(__cpu, TIMER)					\
-	__GEN_RSET_BASE(__cpu, WDT)					\
-	__GEN_RSET_BASE(__cpu, UART0)					\
-	__GEN_RSET_BASE(__cpu, UART1)					\
-	__GEN_RSET_BASE(__cpu, GPIO)					\
-	__GEN_RSET_BASE(__cpu, SPI)					\
-	__GEN_RSET_BASE(__cpu, HSSPI)					\
-	__GEN_RSET_BASE(__cpu, UDC0)					\
-	__GEN_RSET_BASE(__cpu, OHCI0)					\
-	__GEN_RSET_BASE(__cpu, OHCI_PRIV)				\
-	__GEN_RSET_BASE(__cpu, USBH_PRIV)				\
-	__GEN_RSET_BASE(__cpu, USBD)					\
-	__GEN_RSET_BASE(__cpu, USBDMA)					\
-	__GEN_RSET_BASE(__cpu, MPI)					\
-	__GEN_RSET_BASE(__cpu, PCMCIA)					\
-	__GEN_RSET_BASE(__cpu, PCIE)					\
-	__GEN_RSET_BASE(__cpu, DSL)					\
-	__GEN_RSET_BASE(__cpu, ENET0)					\
-	__GEN_RSET_BASE(__cpu, ENET1)					\
-	__GEN_RSET_BASE(__cpu, ENETDMA)					\
-	__GEN_RSET_BASE(__cpu, ENETDMAC)				\
-	__GEN_RSET_BASE(__cpu, ENETDMAS)				\
-	__GEN_RSET_BASE(__cpu, ENETSW)					\
-	__GEN_RSET_BASE(__cpu, EHCI0)					\
-	__GEN_RSET_BASE(__cpu, SDRAM)					\
-	__GEN_RSET_BASE(__cpu, MEMC)					\
-	__GEN_RSET_BASE(__cpu, DDR)					\
-	__GEN_RSET_BASE(__cpu, M2M)					\
-	__GEN_RSET_BASE(__cpu, ATM)					\
-	__GEN_RSET_BASE(__cpu, XTM)					\
-	__GEN_RSET_BASE(__cpu, XTMDMA)					\
-	__GEN_RSET_BASE(__cpu, XTMDMAC)					\
-	__GEN_RSET_BASE(__cpu, XTMDMAS)					\
-	__GEN_RSET_BASE(__cpu, PCM)					\
-	__GEN_RSET_BASE(__cpu, PCMDMA)					\
-	__GEN_RSET_BASE(__cpu, PCMDMAC)					\
-	__GEN_RSET_BASE(__cpu, PCMDMAS)					\
-	__GEN_RSET_BASE(__cpu, RNG)					\
-	__GEN_RSET_BASE(__cpu, MISC)					\
-	}
-
 #define __GEN_CPU_REGS_TABLE(__cpu)					\
 	[RSET_DSL_LMEM]		= BCM_## __cpu ##_DSL_LMEM_BASE,	\
 	[RSET_PERF]		= BCM_## __cpu ##_PERF_BASE,		\
@@ -693,36 +644,7 @@ extern const unsigned long *bcm63xx_regs_base;
 
 static inline unsigned long bcm63xx_regset_address(enum bcm63xx_regs_set set)
 {
-#ifdef BCMCPU_RUNTIME_DETECT
 	return bcm63xx_regs_base[set];
-#else
-#ifdef CONFIG_BCM63XX_CPU_3368
-	__GEN_RSET(3368)
-#endif
-#ifdef CONFIG_BCM63XX_CPU_6328
-	__GEN_RSET(6328)
-#endif
-#ifdef CONFIG_BCM63XX_CPU_6338
-	__GEN_RSET(6338)
-#endif
-#ifdef CONFIG_BCM63XX_CPU_6345
-	__GEN_RSET(6345)
-#endif
-#ifdef CONFIG_BCM63XX_CPU_6348
-	__GEN_RSET(6348)
-#endif
-#ifdef CONFIG_BCM63XX_CPU_6358
-	__GEN_RSET(6358)
-#endif
-#ifdef CONFIG_BCM63XX_CPU_6362
-	__GEN_RSET(6362)
-#endif
-#ifdef CONFIG_BCM63XX_CPU_6368
-	__GEN_RSET(6368)
-#endif
-#endif
-	/* unreached */
-	return 0;
 }
 
 /*
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/8] MIPS: BCM63XX: remove !RUNTIME_DETECT from irq setup code
  2014-07-08 14:53 [PATCH 0/8] MIPS: BCM63XX: remove !RUNTIME_DETECT support Jonas Gorski
  2014-07-08 14:53 ` [PATCH 1/8] MIPS: BCM63XX: remove !RUNTIME_DETECT code from register sets Jonas Gorski
@ 2014-07-08 14:53 ` Jonas Gorski
  2014-07-08 14:53 ` [PATCH 3/8] MIPS: BCM63XX: remove !RUNTIME_DETECT from reset code Jonas Gorski
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Jonas Gorski @ 2014-07-08 14:53 UTC (permalink / raw)
  To: linux-mips
  Cc: Ralf Baechle, John Crispin, Maxime Bizon, Florian Fainelli,
	Kevin Cernekee

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
---
 arch/mips/bcm63xx/irq.c | 109 ------------------------------------------------
 1 file changed, 109 deletions(-)

diff --git a/arch/mips/bcm63xx/irq.c b/arch/mips/bcm63xx/irq.c
index 1525f8a..30c6803 100644
--- a/arch/mips/bcm63xx/irq.c
+++ b/arch/mips/bcm63xx/irq.c
@@ -26,114 +26,6 @@ static void __internal_irq_mask_64(unsigned int irq) __maybe_unused;
 static void __internal_irq_unmask_32(unsigned int irq) __maybe_unused;
 static void __internal_irq_unmask_64(unsigned int irq) __maybe_unused;
 
-#ifndef BCMCPU_RUNTIME_DETECT
-#ifdef CONFIG_BCM63XX_CPU_3368
-#define irq_stat_reg		PERF_IRQSTAT_3368_REG
-#define irq_mask_reg		PERF_IRQMASK_3368_REG
-#define irq_bits		32
-#define is_ext_irq_cascaded	0
-#define ext_irq_start		0
-#define ext_irq_end		0
-#define ext_irq_count		4
-#define ext_irq_cfg_reg1	PERF_EXTIRQ_CFG_REG_3368
-#define ext_irq_cfg_reg2	0
-#endif
-#ifdef CONFIG_BCM63XX_CPU_6328
-#define irq_stat_reg		PERF_IRQSTAT_6328_REG
-#define irq_mask_reg		PERF_IRQMASK_6328_REG
-#define irq_bits		64
-#define is_ext_irq_cascaded	1
-#define ext_irq_start		(BCM_6328_EXT_IRQ0 - IRQ_INTERNAL_BASE)
-#define ext_irq_end		(BCM_6328_EXT_IRQ3 - IRQ_INTERNAL_BASE)
-#define ext_irq_count		4
-#define ext_irq_cfg_reg1	PERF_EXTIRQ_CFG_REG_6328
-#define ext_irq_cfg_reg2	0
-#endif
-#ifdef CONFIG_BCM63XX_CPU_6338
-#define irq_stat_reg		PERF_IRQSTAT_6338_REG
-#define irq_mask_reg		PERF_IRQMASK_6338_REG
-#define irq_bits		32
-#define is_ext_irq_cascaded	0
-#define ext_irq_start		0
-#define ext_irq_end		0
-#define ext_irq_count		4
-#define ext_irq_cfg_reg1	PERF_EXTIRQ_CFG_REG_6338
-#define ext_irq_cfg_reg2	0
-#endif
-#ifdef CONFIG_BCM63XX_CPU_6345
-#define irq_stat_reg		PERF_IRQSTAT_6345_REG
-#define irq_mask_reg		PERF_IRQMASK_6345_REG
-#define irq_bits		32
-#define is_ext_irq_cascaded	0
-#define ext_irq_start		0
-#define ext_irq_end		0
-#define ext_irq_count		4
-#define ext_irq_cfg_reg1	PERF_EXTIRQ_CFG_REG_6345
-#define ext_irq_cfg_reg2	0
-#endif
-#ifdef CONFIG_BCM63XX_CPU_6348
-#define irq_stat_reg		PERF_IRQSTAT_6348_REG
-#define irq_mask_reg		PERF_IRQMASK_6348_REG
-#define irq_bits		32
-#define is_ext_irq_cascaded	0
-#define ext_irq_start		0
-#define ext_irq_end		0
-#define ext_irq_count		4
-#define ext_irq_cfg_reg1	PERF_EXTIRQ_CFG_REG_6348
-#define ext_irq_cfg_reg2	0
-#endif
-#ifdef CONFIG_BCM63XX_CPU_6358
-#define irq_stat_reg		PERF_IRQSTAT_6358_REG
-#define irq_mask_reg		PERF_IRQMASK_6358_REG
-#define irq_bits		32
-#define is_ext_irq_cascaded	1
-#define ext_irq_start		(BCM_6358_EXT_IRQ0 - IRQ_INTERNAL_BASE)
-#define ext_irq_end		(BCM_6358_EXT_IRQ3 - IRQ_INTERNAL_BASE)
-#define ext_irq_count		4
-#define ext_irq_cfg_reg1	PERF_EXTIRQ_CFG_REG_6358
-#define ext_irq_cfg_reg2	0
-#endif
-#ifdef CONFIG_BCM63XX_CPU_6362
-#define irq_stat_reg		PERF_IRQSTAT_6362_REG
-#define irq_mask_reg		PERF_IRQMASK_6362_REG
-#define irq_bits		64
-#define is_ext_irq_cascaded	1
-#define ext_irq_start		(BCM_6362_EXT_IRQ0 - IRQ_INTERNAL_BASE)
-#define ext_irq_end		(BCM_6362_EXT_IRQ3 - IRQ_INTERNAL_BASE)
-#define ext_irq_count		4
-#define ext_irq_cfg_reg1	PERF_EXTIRQ_CFG_REG_6362
-#define ext_irq_cfg_reg2	0
-#endif
-#ifdef CONFIG_BCM63XX_CPU_6368
-#define irq_stat_reg		PERF_IRQSTAT_6368_REG
-#define irq_mask_reg		PERF_IRQMASK_6368_REG
-#define irq_bits		64
-#define is_ext_irq_cascaded	1
-#define ext_irq_start		(BCM_6368_EXT_IRQ0 - IRQ_INTERNAL_BASE)
-#define ext_irq_end		(BCM_6368_EXT_IRQ5 - IRQ_INTERNAL_BASE)
-#define ext_irq_count		6
-#define ext_irq_cfg_reg1	PERF_EXTIRQ_CFG_REG_6368
-#define ext_irq_cfg_reg2	PERF_EXTIRQ_CFG_REG2_6368
-#endif
-
-#if irq_bits == 32
-#define dispatch_internal			__dispatch_internal
-#define internal_irq_mask			__internal_irq_mask_32
-#define internal_irq_unmask			__internal_irq_unmask_32
-#else
-#define dispatch_internal			__dispatch_internal_64
-#define internal_irq_mask			__internal_irq_mask_64
-#define internal_irq_unmask			__internal_irq_unmask_64
-#endif
-
-#define irq_stat_addr	(bcm63xx_regset_address(RSET_PERF) + irq_stat_reg)
-#define irq_mask_addr	(bcm63xx_regset_address(RSET_PERF) + irq_mask_reg)
-
-static inline void bcm63xx_init_irq(void)
-{
-}
-#else /* ! BCMCPU_RUNTIME_DETECT */
-
 static u32 irq_stat_addr, irq_mask_addr;
 static void (*dispatch_internal)(void);
 static int is_ext_irq_cascaded;
@@ -234,7 +126,6 @@ static void bcm63xx_init_irq(void)
 		internal_irq_unmask = __internal_irq_unmask_64;
 	}
 }
-#endif /* ! BCMCPU_RUNTIME_DETECT */
 
 static inline u32 get_ext_irq_perf_reg(int irq)
 {
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/8] MIPS: BCM63XX: remove !RUNTIME_DETECT from reset code
  2014-07-08 14:53 [PATCH 0/8] MIPS: BCM63XX: remove !RUNTIME_DETECT support Jonas Gorski
  2014-07-08 14:53 ` [PATCH 1/8] MIPS: BCM63XX: remove !RUNTIME_DETECT code from register sets Jonas Gorski
  2014-07-08 14:53 ` [PATCH 2/8] MIPS: BCM63XX: remove !RUNTIME_DETECT from irq setup code Jonas Gorski
@ 2014-07-08 14:53 ` Jonas Gorski
  2014-07-08 14:53 ` [PATCH 4/8] MIPS: BCM63XX: remove !RUNTIME_DETECT code from gpio code Jonas Gorski
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Jonas Gorski @ 2014-07-08 14:53 UTC (permalink / raw)
  To: linux-mips
  Cc: Ralf Baechle, John Crispin, Maxime Bizon, Florian Fainelli,
	Kevin Cernekee

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
---
 arch/mips/bcm63xx/reset.c | 60 -----------------------------------------------
 1 file changed, 60 deletions(-)

diff --git a/arch/mips/bcm63xx/reset.c b/arch/mips/bcm63xx/reset.c
index acbeb1f..d1fe51e 100644
--- a/arch/mips/bcm63xx/reset.c
+++ b/arch/mips/bcm63xx/reset.c
@@ -125,8 +125,6 @@
 #define BCM6368_RESET_PCIE	0
 #define BCM6368_RESET_PCIE_EXT	0
 
-#ifdef BCMCPU_RUNTIME_DETECT
-
 /*
  * core reset bits
  */
@@ -188,64 +186,6 @@ static int __init bcm63xx_reset_bits_init(void)
 
 	return 0;
 }
-#else
-
-#ifdef CONFIG_BCM63XX_CPU_3368
-static const u32 bcm63xx_reset_bits[] = {
-	__GEN_RESET_BITS_TABLE(3368)
-};
-#define reset_reg PERF_SOFTRESET_6358_REG
-#endif
-
-#ifdef CONFIG_BCM63XX_CPU_6328
-static const u32 bcm63xx_reset_bits[] = {
-	__GEN_RESET_BITS_TABLE(6328)
-};
-#define reset_reg PERF_SOFTRESET_6328_REG
-#endif
-
-#ifdef CONFIG_BCM63XX_CPU_6338
-static const u32 bcm63xx_reset_bits[] = {
-	__GEN_RESET_BITS_TABLE(6338)
-};
-#define reset_reg PERF_SOFTRESET_REG
-#endif
-
-#ifdef CONFIG_BCM63XX_CPU_6345
-static const u32 bcm63xx_reset_bits[] = { };
-#define reset_reg 0
-#endif
-
-#ifdef CONFIG_BCM63XX_CPU_6348
-static const u32 bcm63xx_reset_bits[] = {
-	__GEN_RESET_BITS_TABLE(6348)
-};
-#define reset_reg PERF_SOFTRESET_REG
-#endif
-
-#ifdef CONFIG_BCM63XX_CPU_6358
-static const u32 bcm63xx_reset_bits[] = {
-	__GEN_RESET_BITS_TABLE(6358)
-};
-#define reset_reg PERF_SOFTRESET_6358_REG
-#endif
-
-#ifdef CONFIG_BCM63XX_CPU_6362
-static const u32 bcm63xx_reset_bits[] = {
-	__GEN_RESET_BITS_TABLE(6362)
-};
-#define reset_reg PERF_SOFTRESET_6362_REG
-#endif
-
-#ifdef CONFIG_BCM63XX_CPU_6368
-static const u32 bcm63xx_reset_bits[] = {
-	__GEN_RESET_BITS_TABLE(6368)
-};
-#define reset_reg PERF_SOFTRESET_6368_REG
-#endif
-
-static int __init bcm63xx_reset_bits_init(void) { return 0; }
-#endif
 
 static DEFINE_SPINLOCK(reset_mutex);
 
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/8] MIPS: BCM63XX: remove !RUNTIME_DETECT code from gpio code
  2014-07-08 14:53 [PATCH 0/8] MIPS: BCM63XX: remove !RUNTIME_DETECT support Jonas Gorski
                   ` (2 preceding siblings ...)
  2014-07-08 14:53 ` [PATCH 3/8] MIPS: BCM63XX: remove !RUNTIME_DETECT from reset code Jonas Gorski
@ 2014-07-08 14:53 ` Jonas Gorski
  2014-07-08 14:53 ` [PATCH 5/8] MIPS: BCM63XX: remove !RUNTIME_DETECT from spi code Jonas Gorski
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Jonas Gorski @ 2014-07-08 14:53 UTC (permalink / raw)
  To: linux-mips
  Cc: Ralf Baechle, John Crispin, Maxime Bizon, Florian Fainelli,
	Kevin Cernekee

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
---
 arch/mips/bcm63xx/gpio.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/arch/mips/bcm63xx/gpio.c b/arch/mips/bcm63xx/gpio.c
index a6c2135..468bc7b 100644
--- a/arch/mips/bcm63xx/gpio.c
+++ b/arch/mips/bcm63xx/gpio.c
@@ -18,19 +18,6 @@
 #include <bcm63xx_io.h>
 #include <bcm63xx_regs.h>
 
-#ifndef BCMCPU_RUNTIME_DETECT
-#define gpio_out_low_reg	GPIO_DATA_LO_REG
-#ifdef CONFIG_BCM63XX_CPU_6345
-#ifdef gpio_out_low_reg
-#undef gpio_out_low_reg
-#define gpio_out_low_reg	GPIO_DATA_LO_REG_6345
-#endif /* gpio_out_low_reg */
-#endif /* CONFIG_BCM63XX_CPU_6345 */
-
-static inline void bcm63xx_gpio_out_low_reg_init(void)
-{
-}
-#else /* ! BCMCPU_RUNTIME_DETECT */
 static u32 gpio_out_low_reg;
 
 static void bcm63xx_gpio_out_low_reg_init(void)
@@ -44,7 +31,6 @@ static void bcm63xx_gpio_out_low_reg_init(void)
 		break;
 	}
 }
-#endif /* ! BCMCPU_RUNTIME_DETECT */
 
 static DEFINE_SPINLOCK(bcm63xx_gpio_lock);
 static u32 gpio_out_low, gpio_out_high;
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/8] MIPS: BCM63XX: remove !RUNTIME_DETECT from spi code
  2014-07-08 14:53 [PATCH 0/8] MIPS: BCM63XX: remove !RUNTIME_DETECT support Jonas Gorski
                   ` (3 preceding siblings ...)
  2014-07-08 14:53 ` [PATCH 4/8] MIPS: BCM63XX: remove !RUNTIME_DETECT code from gpio code Jonas Gorski
@ 2014-07-08 14:53 ` Jonas Gorski
  2014-07-08 14:53 ` [PATCH 6/8] MIPS: BCM63XX: remove !RUNTIME_DETECT usage from enet code Jonas Gorski
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Jonas Gorski @ 2014-07-08 14:53 UTC (permalink / raw)
  To: linux-mips
  Cc: Ralf Baechle, John Crispin, Maxime Bizon, Florian Fainelli,
	Kevin Cernekee

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
---
 arch/mips/bcm63xx/dev-spi.c                        |  4 ---
 .../include/asm/mach-bcm63xx/bcm63xx_dev_spi.h     | 31 ----------------------
 2 files changed, 35 deletions(-)

diff --git a/arch/mips/bcm63xx/dev-spi.c b/arch/mips/bcm63xx/dev-spi.c
index d12daed..ad448e4 100644
--- a/arch/mips/bcm63xx/dev-spi.c
+++ b/arch/mips/bcm63xx/dev-spi.c
@@ -18,7 +18,6 @@
 #include <bcm63xx_dev_spi.h>
 #include <bcm63xx_regs.h>
 
-#ifdef BCMCPU_RUNTIME_DETECT
 /*
  * register offsets
  */
@@ -41,9 +40,6 @@ static __init void bcm63xx_spi_regs_init(void)
 		BCMCPU_IS_6362() || BCMCPU_IS_6368())
 		bcm63xx_regs_spi = bcm6358_regs_spi;
 }
-#else
-static __init void bcm63xx_spi_regs_init(void) { }
-#endif
 
 static struct resource spi_resources[] = {
 	{
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h
index c426cab..2573765 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h
@@ -30,26 +30,6 @@ enum bcm63xx_regs_spi {
 	SPI_RX_DATA,
 };
 
-#define __GEN_SPI_RSET_BASE(__cpu, __rset)				\
-	case SPI_## __rset:						\
-		return SPI_## __cpu ##_## __rset;
-
-#define __GEN_SPI_RSET(__cpu)						\
-	switch (reg) {							\
-	__GEN_SPI_RSET_BASE(__cpu, CMD)					\
-	__GEN_SPI_RSET_BASE(__cpu, INT_STATUS)				\
-	__GEN_SPI_RSET_BASE(__cpu, INT_MASK_ST)				\
-	__GEN_SPI_RSET_BASE(__cpu, INT_MASK)				\
-	__GEN_SPI_RSET_BASE(__cpu, ST)					\
-	__GEN_SPI_RSET_BASE(__cpu, CLK_CFG)				\
-	__GEN_SPI_RSET_BASE(__cpu, FILL_BYTE)				\
-	__GEN_SPI_RSET_BASE(__cpu, MSG_TAIL)				\
-	__GEN_SPI_RSET_BASE(__cpu, RX_TAIL)				\
-	__GEN_SPI_RSET_BASE(__cpu, MSG_CTL)				\
-	__GEN_SPI_RSET_BASE(__cpu, MSG_DATA)				\
-	__GEN_SPI_RSET_BASE(__cpu, RX_DATA)				\
-	}
-
 #define __GEN_SPI_REGS_TABLE(__cpu)					\
 	[SPI_CMD]		= SPI_## __cpu ##_CMD,			\
 	[SPI_INT_STATUS]	= SPI_## __cpu ##_INT_STATUS,		\
@@ -66,20 +46,9 @@ enum bcm63xx_regs_spi {
 
 static inline unsigned long bcm63xx_spireg(enum bcm63xx_regs_spi reg)
 {
-#ifdef BCMCPU_RUNTIME_DETECT
 	extern const unsigned long *bcm63xx_regs_spi;
 
 	return bcm63xx_regs_spi[reg];
-#else
-#if defined(CONFIG_BCM63XX_CPU_6338) || defined(CONFIG_BCM63XX_CPU_6348)
-	__GEN_SPI_RSET(6348)
-#endif
-#if defined(CONFIG_BCM63XX_CPU_6358) || defined(CONFIG_BCM63XX_CPU_6362) || \
-	defined(CONFIG_BCM63XX_CPU_6368)
-	__GEN_SPI_RSET(6358)
-#endif
-#endif
-	return 0;
 }
 
 #endif /* BCM63XX_DEV_SPI_H */
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 6/8] MIPS: BCM63XX: remove !RUNTIME_DETECT usage from enet code
  2014-07-08 14:53 [PATCH 0/8] MIPS: BCM63XX: remove !RUNTIME_DETECT support Jonas Gorski
                   ` (4 preceding siblings ...)
  2014-07-08 14:53 ` [PATCH 5/8] MIPS: BCM63XX: remove !RUNTIME_DETECT from spi code Jonas Gorski
@ 2014-07-08 14:53 ` Jonas Gorski
       [not found]   ` <53BC156D.6080106@cogentembedded.com>
  2014-07-08 14:53 ` [PATCH 7/8] MIPS: BCM63XX: remove !RUNTIME_DETECT in cpu-feature-overrides Jonas Gorski
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 12+ messages in thread
From: Jonas Gorski @ 2014-07-08 14:53 UTC (permalink / raw)
  To: linux-mips
  Cc: Ralf Baechle, John Crispin, Maxime Bizon, Florian Fainelli,
	Kevin Cernekee

---
 arch/mips/bcm63xx/dev-enet.c                       |  4 --
 .../include/asm/mach-bcm63xx/bcm63xx_dev_enet.h    | 46 ----------------------
 2 files changed, 50 deletions(-)

diff --git a/arch/mips/bcm63xx/dev-enet.c b/arch/mips/bcm63xx/dev-enet.c
index 52bc01d..e828477 100644
--- a/arch/mips/bcm63xx/dev-enet.c
+++ b/arch/mips/bcm63xx/dev-enet.c
@@ -14,7 +14,6 @@
 #include <bcm63xx_io.h>
 #include <bcm63xx_regs.h>
 
-#ifdef BCMCPU_RUNTIME_DETECT
 static const unsigned long bcm6348_regs_enetdmac[] = {
 	[ENETDMAC_CHANCFG]	= ENETDMAC_CHANCFG_REG,
 	[ENETDMAC_IR]		= ENETDMAC_IR_REG,
@@ -43,9 +42,6 @@ static __init void bcm63xx_enetdmac_regs_init(void)
 	else
 		bcm63xx_regs_enetdmac = bcm6348_regs_enetdmac;
 }
-#else
-static __init void bcm63xx_enetdmac_regs_init(void) { }
-#endif
 
 static struct resource shared_res[] = {
 	{
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
index 753953e..466fc85 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
@@ -112,55 +112,9 @@ enum bcm63xx_regs_enetdmac {
 
 static inline unsigned long bcm63xx_enetdmacreg(enum bcm63xx_regs_enetdmac reg)
 {
-#ifdef BCMCPU_RUNTIME_DETECT
 	extern const unsigned long *bcm63xx_regs_enetdmac;
 
 	return bcm63xx_regs_enetdmac[reg];
-#else
-#ifdef CONFIG_BCM63XX_CPU_6345
-	switch (reg) {
-	case ENETDMAC_CHANCFG:
-		return ENETDMA_6345_CHANCFG_REG;
-	case ENETDMAC_IR:
-		return ENETDMA_6345_IR_REG;
-	case ENETDMAC_IRMASK:
-		return ENETDMA_6345_IRMASK_REG;
-	case ENETDMAC_MAXBURST:
-		return ENETDMA_6345_MAXBURST_REG;
-	case ENETDMAC_BUFALLOC:
-		return ENETDMA_6345_BUFALLOC_REG;
-	case ENETDMAC_RSTART:
-		return ENETDMA_6345_RSTART_REG;
-	case ENETDMAC_FC:
-		return ENETDMA_6345_FC_REG;
-	case ENETDMAC_LEN:
-		return ENETDMA_6345_LEN_REG;
-	}
-#endif
-#if defined(CONFIG_BCM63XX_CPU_6328) || \
-	defined(CONFIG_BCM63XX_CPU_6338) || \
-	defined(CONFIG_BCM63XX_CPU_6348) || \
-	defined(CONFIG_BCM63XX_CPU_6358) || \
-	defined(CONFIG_BCM63XX_CPU_6362) || \
-	defined(CONFIG_BCM63XX_CPU_6368)
-	switch (reg) {
-	case ENETDMAC_CHANCFG:
-		return ENETDMAC_CHANCFG_REG;
-	case ENETDMAC_IR:
-		return ENETDMAC_IR_REG;
-	case ENETDMAC_IRMASK:
-		return ENETDMAC_IRMASK_REG;
-	case ENETDMAC_MAXBURST:
-		return ENETDMAC_MAXBURST_REG;
-	case ENETDMAC_BUFALLOC:
-	case ENETDMAC_RSTART:
-	case ENETDMAC_FC:
-	case ENETDMAC_LEN:
-		return 0;
-	}
-#endif
-#endif
-	return 0;
 }
 
 
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 7/8] MIPS: BCM63XX: remove !RUNTIME_DETECT in cpu-feature-overrides
  2014-07-08 14:53 [PATCH 0/8] MIPS: BCM63XX: remove !RUNTIME_DETECT support Jonas Gorski
                   ` (5 preceding siblings ...)
  2014-07-08 14:53 ` [PATCH 6/8] MIPS: BCM63XX: remove !RUNTIME_DETECT usage from enet code Jonas Gorski
@ 2014-07-08 14:53 ` Jonas Gorski
  2014-11-05 20:36   ` Kevin Cernekee
  2014-07-08 14:53 ` [PATCH 8/8] MIPS: BCM63XX: remove !RUNTIME_DETECT code for bcmcpu_get_id Jonas Gorski
  2014-07-09 19:48 ` [PATCH 0/8] MIPS: BCM63XX: remove !RUNTIME_DETECT support Florian Fainelli
  8 siblings, 1 reply; 12+ messages in thread
From: Jonas Gorski @ 2014-07-08 14:53 UTC (permalink / raw)
  To: linux-mips
  Cc: Ralf Baechle, John Crispin, Maxime Bizon, Florian Fainelli,
	Kevin Cernekee

All three SoCs have in common they have a BMIPS32/BMIPS3300 CPU, so
we can replace this as no SoC with BMIPS4350 support enabled.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
---
 arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h b/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
index e9c408e..bc1167d 100644
--- a/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
@@ -24,7 +24,7 @@
 #define cpu_has_smartmips		0
 #define cpu_has_vtag_icache		0
 
-#if !defined(BCMCPU_RUNTIME_DETECT) && (defined(CONFIG_BCM63XX_CPU_6348) || defined(CONFIG_BCM63XX_CPU_6345) || defined(CONFIG_BCM63XX_CPU_6338))
+#if !defined(CONFIG_SYS_HAS_CPU_BMIPS4350)
 #define cpu_has_dc_aliases		0
 #endif
 
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 8/8] MIPS: BCM63XX: remove !RUNTIME_DETECT code for bcmcpu_get_id
  2014-07-08 14:53 [PATCH 0/8] MIPS: BCM63XX: remove !RUNTIME_DETECT support Jonas Gorski
                   ` (6 preceding siblings ...)
  2014-07-08 14:53 ` [PATCH 7/8] MIPS: BCM63XX: remove !RUNTIME_DETECT in cpu-feature-overrides Jonas Gorski
@ 2014-07-08 14:53 ` Jonas Gorski
  2014-07-09 19:48 ` [PATCH 0/8] MIPS: BCM63XX: remove !RUNTIME_DETECT support Florian Fainelli
  8 siblings, 0 replies; 12+ messages in thread
From: Jonas Gorski @ 2014-07-08 14:53 UTC (permalink / raw)
  To: linux-mips
  Cc: Ralf Baechle, John Crispin, Maxime Bizon, Florian Fainelli,
	Kevin Cernekee

Use the same pattern as with get_*_cpu_type() to allow the compiler
to remove code for non enabled SoC types.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
---
 arch/mips/bcm63xx/cpu.c                          |  11 +--
 arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h | 120 +++++++----------------
 2 files changed, 38 insertions(+), 93 deletions(-)

diff --git a/arch/mips/bcm63xx/cpu.c b/arch/mips/bcm63xx/cpu.c
index fd4e76c..536f644 100644
--- a/arch/mips/bcm63xx/cpu.c
+++ b/arch/mips/bcm63xx/cpu.c
@@ -24,7 +24,9 @@ EXPORT_SYMBOL(bcm63xx_regs_base);
 const int *bcm63xx_irqs;
 EXPORT_SYMBOL(bcm63xx_irqs);
 
-static u16 bcm63xx_cpu_id;
+u16 bcm63xx_cpu_id __read_mostly;
+EXPORT_SYMBOL(bcm63xx_cpu_id);
+
 static u8 bcm63xx_cpu_rev;
 static unsigned int bcm63xx_cpu_freq;
 static unsigned int bcm63xx_memory_size;
@@ -97,13 +99,6 @@ static const int bcm6368_irqs[] = {
 
 };
 
-u16 __bcm63xx_get_cpu_id(void)
-{
-	return bcm63xx_cpu_id;
-}
-
-EXPORT_SYMBOL(__bcm63xx_get_cpu_id);
-
 u8 bcm63xx_get_cpu_rev(void)
 {
 	return bcm63xx_cpu_rev;
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
index 4d76fc7..56bb192 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
@@ -19,118 +19,68 @@
 #define BCM6368_CPU_ID		0x6368
 
 void __init bcm63xx_cpu_init(void);
-u16 __bcm63xx_get_cpu_id(void);
 u8 bcm63xx_get_cpu_rev(void);
 unsigned int bcm63xx_get_cpu_freq(void);
 
+static inline u16 __pure __bcm63xx_get_cpu_id(const u16 cpu_id)
+{
+	switch (cpu_id) {
 #ifdef CONFIG_BCM63XX_CPU_3368
-# ifdef bcm63xx_get_cpu_id
-#  undef bcm63xx_get_cpu_id
-#  define bcm63xx_get_cpu_id()	__bcm63xx_get_cpu_id()
-#  define BCMCPU_RUNTIME_DETECT
-# else
-#  define bcm63xx_get_cpu_id()	BCM3368_CPU_ID
-# endif
-# define BCMCPU_IS_3368()	(bcm63xx_get_cpu_id() == BCM3368_CPU_ID)
-#else
-# define BCMCPU_IS_3368()	(0)
+		case BCM3368_CPU_ID:
 #endif
 
 #ifdef CONFIG_BCM63XX_CPU_6328
-# ifdef bcm63xx_get_cpu_id
-#  undef bcm63xx_get_cpu_id
-#  define bcm63xx_get_cpu_id()	__bcm63xx_get_cpu_id()
-#  define BCMCPU_RUNTIME_DETECT
-# else
-#  define bcm63xx_get_cpu_id()	BCM6328_CPU_ID
-# endif
-# define BCMCPU_IS_6328()	(bcm63xx_get_cpu_id() == BCM6328_CPU_ID)
-#else
-# define BCMCPU_IS_6328()	(0)
+		case BCM6328_CPU_ID:
 #endif
 
 #ifdef CONFIG_BCM63XX_CPU_6338
-# ifdef bcm63xx_get_cpu_id
-#  undef bcm63xx_get_cpu_id
-#  define bcm63xx_get_cpu_id()	__bcm63xx_get_cpu_id()
-#  define BCMCPU_RUNTIME_DETECT
-# else
-#  define bcm63xx_get_cpu_id()	BCM6338_CPU_ID
-# endif
-# define BCMCPU_IS_6338()	(bcm63xx_get_cpu_id() == BCM6338_CPU_ID)
-#else
-# define BCMCPU_IS_6338()	(0)
+		case BCM6338_CPU_ID:
 #endif
 
 #ifdef CONFIG_BCM63XX_CPU_6345
-# ifdef bcm63xx_get_cpu_id
-#  undef bcm63xx_get_cpu_id
-#  define bcm63xx_get_cpu_id()	__bcm63xx_get_cpu_id()
-#  define BCMCPU_RUNTIME_DETECT
-# else
-#  define bcm63xx_get_cpu_id()	BCM6345_CPU_ID
-# endif
-# define BCMCPU_IS_6345()	(bcm63xx_get_cpu_id() == BCM6345_CPU_ID)
-#else
-# define BCMCPU_IS_6345()	(0)
+		case BCM6345_CPU_ID:
 #endif
 
 #ifdef CONFIG_BCM63XX_CPU_6348
-# ifdef bcm63xx_get_cpu_id
-#  undef bcm63xx_get_cpu_id
-#  define bcm63xx_get_cpu_id()	__bcm63xx_get_cpu_id()
-#  define BCMCPU_RUNTIME_DETECT
-# else
-#  define bcm63xx_get_cpu_id()	BCM6348_CPU_ID
-# endif
-# define BCMCPU_IS_6348()	(bcm63xx_get_cpu_id() == BCM6348_CPU_ID)
-#else
-# define BCMCPU_IS_6348()	(0)
+		case BCM6348_CPU_ID:
 #endif
 
 #ifdef CONFIG_BCM63XX_CPU_6358
-# ifdef bcm63xx_get_cpu_id
-#  undef bcm63xx_get_cpu_id
-#  define bcm63xx_get_cpu_id()	__bcm63xx_get_cpu_id()
-#  define BCMCPU_RUNTIME_DETECT
-# else
-#  define bcm63xx_get_cpu_id()	BCM6358_CPU_ID
-# endif
-# define BCMCPU_IS_6358()	(bcm63xx_get_cpu_id() == BCM6358_CPU_ID)
-#else
-# define BCMCPU_IS_6358()	(0)
+		case BCM6358_CPU_ID:
 #endif
 
 #ifdef CONFIG_BCM63XX_CPU_6362
-# ifdef bcm63xx_get_cpu_id
-#  undef bcm63xx_get_cpu_id
-#  define bcm63xx_get_cpu_id()	__bcm63xx_get_cpu_id()
-#  define BCMCPU_RUNTIME_DETECT
-# else
-#  define bcm63xx_get_cpu_id()	BCM6362_CPU_ID
-# endif
-# define BCMCPU_IS_6362()	(bcm63xx_get_cpu_id() == BCM6362_CPU_ID)
-#else
-# define BCMCPU_IS_6362()	(0)
+		case BCM6362_CPU_ID:
 #endif
 
-
 #ifdef CONFIG_BCM63XX_CPU_6368
-# ifdef bcm63xx_get_cpu_id
-#  undef bcm63xx_get_cpu_id
-#  define bcm63xx_get_cpu_id()	__bcm63xx_get_cpu_id()
-#  define BCMCPU_RUNTIME_DETECT
-# else
-#  define bcm63xx_get_cpu_id()	BCM6368_CPU_ID
-# endif
-# define BCMCPU_IS_6368()	(bcm63xx_get_cpu_id() == BCM6368_CPU_ID)
-#else
-# define BCMCPU_IS_6368()	(0)
+		case BCM6368_CPU_ID:
 #endif
+		break;
+	default:
+		unreachable();
+	}
 
-#ifndef bcm63xx_get_cpu_id
-#error "No CPU support configured"
-#endif
+	return cpu_id;
+}
+
+extern u16 bcm63xx_cpu_id;
+
+static inline u16 __pure bcm63xx_get_cpu_id(void)
+{
+	const u16 cpu_id = bcm63xx_cpu_id;
+
+	return __bcm63xx_get_cpu_id(cpu_id);
+}
+
+#define BCMCPU_IS_3368()	(bcm63xx_get_cpu_id() == BCM3368_CPU_ID)
+#define BCMCPU_IS_6328()	(bcm63xx_get_cpu_id() == BCM6328_CPU_ID)
+#define BCMCPU_IS_6338()	(bcm63xx_get_cpu_id() == BCM6338_CPU_ID)
+#define BCMCPU_IS_6345()	(bcm63xx_get_cpu_id() == BCM6345_CPU_ID)
+#define BCMCPU_IS_6348()	(bcm63xx_get_cpu_id() == BCM6348_CPU_ID)
+#define BCMCPU_IS_6358()	(bcm63xx_get_cpu_id() == BCM6358_CPU_ID)
+#define BCMCPU_IS_6362()	(bcm63xx_get_cpu_id() == BCM6362_CPU_ID)
+#define BCMCPU_IS_6368()	(bcm63xx_get_cpu_id() == BCM6368_CPU_ID)
 
 /*
  * While registers sets are (mostly) the same across 63xx CPU, base
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 6/8] MIPS: BCM63XX: remove !RUNTIME_DETECT usage from enet code
       [not found]   ` <53BC156D.6080106@cogentembedded.com>
@ 2014-07-09 11:58     ` Jonas Gorski
  0 siblings, 0 replies; 12+ messages in thread
From: Jonas Gorski @ 2014-07-09 11:58 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: linux-mips, Ralf Baechle, John Crispin, Maxime Bizon,
	Florian Fainelli, Kevin Cernekee

On Tue, 08 Jul 2014 19:59:41 +0400
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> wrote:

> Hello.
> 
>     You forgot to si.gn off on this patch.

(added a dot into sign to make ecartis not detect a command)

Indeed I have, thanks for spotting this. *cough*
 
Sooo ... *looks at patchwork*
 
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
 

Jonas

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/8] MIPS: BCM63XX: remove !RUNTIME_DETECT support
  2014-07-08 14:53 [PATCH 0/8] MIPS: BCM63XX: remove !RUNTIME_DETECT support Jonas Gorski
                   ` (7 preceding siblings ...)
  2014-07-08 14:53 ` [PATCH 8/8] MIPS: BCM63XX: remove !RUNTIME_DETECT code for bcmcpu_get_id Jonas Gorski
@ 2014-07-09 19:48 ` Florian Fainelli
  8 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2014-07-09 19:48 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: Linux-MIPS, Ralf Baechle, John Crispin, Maxime Bizon,
	Kevin Cernekee

2014-07-08 7:53 GMT-07:00 Jonas Gorski <jogo@openwrt.org>:
> The advantages compared to the added maintaince burden of ensuring
> that changes don't break the single-soc support with !RUNTIME_DETECT
> are rather small, so remove it.
>
> The only place where it might have any impact might be the irq code.
> But even then replacing it with UASM might be a better choice, as it
> would then profit all targets.
>
> P.S: there is a small lie in 7/8, but since BCM6318 support isn't
> yet upstream, it is valid for the current code. BCM6318 has only
> a BCM3300 CPU, but it does have dc aliases (at least according to
> the bootlog).

Looks good to me, thanks Jonas!

Acked-by: Florian Fainelli <florian@openwrt.org>

>
> Jonas Gorski (8):
>   MIPS: BCM63XX: remove !RUNTIME_DETECT code from register sets
>   MIPS: BCM63XX: remove !RUNTIME_DETECT from irq setup code
>   MIPS: BCM63XX: remove !RUNTIME_DETECT from reset code
>   MIPS: BCM63XX: remove !RUNTIME_DETECT code from gpio code
>   MIPS: BCM63XX: remove !RUNTIME_DETECT from spi code
>   MIPS: BCM63XX: remove !RUNTIME_DETECT usage from enet code
>   MIPS: BCM63XX: remove !RUNTIME_DETECT in cpu-feature-overrides
>   MIPS: BCM63XX: remove !RUNTIME_DETECT code for bcmcpu_get_id
>
>  arch/mips/bcm63xx/cpu.c                            |  11 +-
>  arch/mips/bcm63xx/dev-enet.c                       |   4 -
>  arch/mips/bcm63xx/dev-spi.c                        |   4 -
>  arch/mips/bcm63xx/gpio.c                           |  14 --
>  arch/mips/bcm63xx/irq.c                            | 109 ------------
>  arch/mips/bcm63xx/reset.c                          |  60 -------
>  arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h   | 198 ++++-----------------
>  .../include/asm/mach-bcm63xx/bcm63xx_dev_enet.h    |  46 -----
>  .../include/asm/mach-bcm63xx/bcm63xx_dev_spi.h     |  31 ----
>  .../asm/mach-bcm63xx/cpu-feature-overrides.h       |   2 +-
>  10 files changed, 39 insertions(+), 440 deletions(-)
>
> --
> 2.0.0



-- 
Florian

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 7/8] MIPS: BCM63XX: remove !RUNTIME_DETECT in cpu-feature-overrides
  2014-07-08 14:53 ` [PATCH 7/8] MIPS: BCM63XX: remove !RUNTIME_DETECT in cpu-feature-overrides Jonas Gorski
@ 2014-11-05 20:36   ` Kevin Cernekee
  0 siblings, 0 replies; 12+ messages in thread
From: Kevin Cernekee @ 2014-11-05 20:36 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: Linux MIPS Mailing List, Ralf Baechle, John Crispin, Maxime Bizon,
	Florian Fainelli, Steven J. Hill

On Tue, Jul 8, 2014 at 7:53 AM, Jonas Gorski <jogo@openwrt.org> wrote:
> All three SoCs have in common they have a BMIPS32/BMIPS3300 CPU, so
> we can replace this as no SoC with BMIPS4350 support enabled.
>
> Signed-off-by: Jonas Gorski <jogo@openwrt.org>
> ---
>  arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h b/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
> index e9c408e..bc1167d 100644
> --- a/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
> +++ b/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
> @@ -24,7 +24,7 @@
>  #define cpu_has_smartmips              0
>  #define cpu_has_vtag_icache            0
>
> -#if !defined(BCMCPU_RUNTIME_DETECT) && (defined(CONFIG_BCM63XX_CPU_6348) || defined(CONFIG_BCM63XX_CPU_6345) || defined(CONFIG_BCM63XX_CPU_6338))
> +#if !defined(CONFIG_SYS_HAS_CPU_BMIPS4350)
>  #define cpu_has_dc_aliases             0
>  #endif

Note that BCM6318 uses a 40nm BMIPS3300 with a 32kB D$.  I haven't
actually booted one of these myself but I would assume the way size is
either 16kB or 8kB.

I'm seeing another issue with the generic cpu_has_dc_aliases
implementation (cpu_data[0].dcache.flags & MIPS_CACHE_ALIASES).  The
HIGHMEM check in paging_init() runs before cpu_cache_init(), so
cpu_data[0].dcache.flags is still 0 and cpu_has_dc_aliases will never
be true at this point unless it was defined at compile time.

There seem to be some other problems with the way the HIGHMEM check is
handled, and I'm tempted to just move it after cpu_cache_init() and
make it a fatal error condition.  Then it can be removed entirely when
imgtec finalizes the "cache aliases + HIGHMEM" patch series.

Any opinions?

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-11-05 20:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-08 14:53 [PATCH 0/8] MIPS: BCM63XX: remove !RUNTIME_DETECT support Jonas Gorski
2014-07-08 14:53 ` [PATCH 1/8] MIPS: BCM63XX: remove !RUNTIME_DETECT code from register sets Jonas Gorski
2014-07-08 14:53 ` [PATCH 2/8] MIPS: BCM63XX: remove !RUNTIME_DETECT from irq setup code Jonas Gorski
2014-07-08 14:53 ` [PATCH 3/8] MIPS: BCM63XX: remove !RUNTIME_DETECT from reset code Jonas Gorski
2014-07-08 14:53 ` [PATCH 4/8] MIPS: BCM63XX: remove !RUNTIME_DETECT code from gpio code Jonas Gorski
2014-07-08 14:53 ` [PATCH 5/8] MIPS: BCM63XX: remove !RUNTIME_DETECT from spi code Jonas Gorski
2014-07-08 14:53 ` [PATCH 6/8] MIPS: BCM63XX: remove !RUNTIME_DETECT usage from enet code Jonas Gorski
     [not found]   ` <53BC156D.6080106@cogentembedded.com>
2014-07-09 11:58     ` Jonas Gorski
2014-07-08 14:53 ` [PATCH 7/8] MIPS: BCM63XX: remove !RUNTIME_DETECT in cpu-feature-overrides Jonas Gorski
2014-11-05 20:36   ` Kevin Cernekee
2014-07-08 14:53 ` [PATCH 8/8] MIPS: BCM63XX: remove !RUNTIME_DETECT code for bcmcpu_get_id Jonas Gorski
2014-07-09 19:48 ` [PATCH 0/8] MIPS: BCM63XX: remove !RUNTIME_DETECT support Florian Fainelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox