333-MIPS-BCM63XX-detect-BCM6362-variants.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From 04458c3db8eb79da21ecde40ab36a1dde52bef06 Mon Sep 17 00:00:00 2001
  2. From: Jonas Gorski <jogo@openwrt.org>
  3. Date: Sat, 7 Dec 2013 14:33:28 +0100
  4. Subject: [PATCH 23/45] MIPS: BCM63XX: detect BCM6362 variants
  5. ---
  6. arch/mips/bcm63xx/cpu.c | 8 ++++++++
  7. arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h | 3 +++
  8. 2 files changed, 11 insertions(+)
  9. --- a/arch/mips/bcm63xx/cpu.c
  10. +++ b/arch/mips/bcm63xx/cpu.c
  11. @@ -383,6 +383,14 @@ void __init bcm63xx_cpu_init(void)
  12. case BCM6362_CPU_ID:
  13. bcm63xx_regs_base = bcm6362_regs_base;
  14. bcm63xx_irqs = bcm6362_irqs;
  15. +
  16. + if (varid == 1)
  17. + bcm63xx_cpu_variant = BCM6362_CPU_ID;
  18. + else if (varid == 2)
  19. + bcm63xx_cpu_variant = BCM6361_CPU_ID;
  20. + else
  21. + pr_warn("unknown BCM6362 variant: %x\n", varid);
  22. +
  23. break;
  24. case BCM6368_CPU_ID:
  25. bcm63xx_regs_base = bcm6368_regs_base;
  26. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
  27. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
  28. @@ -17,6 +17,7 @@
  29. #define BCM6345_CPU_ID 0x6345
  30. #define BCM6348_CPU_ID 0x6348
  31. #define BCM6358_CPU_ID 0x6358
  32. +#define BCM6361_CPU_ID 0x6361
  33. #define BCM6362_CPU_ID 0x6362
  34. #define BCM6368_CPU_ID 0x6368
  35. @@ -99,6 +100,8 @@ static inline u16 __pure bcm63xx_get_cpu
  36. (bcm63xx_get_cpu_variant() == BCM6348_CPU_ID)
  37. #define BCMCPU_VARIANT_IS_6358() \
  38. (bcm63xx_get_cpu_cariant() == BCM6358_CPU_ID)
  39. +#define BCMCPU_VARIANT_IS_6361() \
  40. + (bcm63xx_get_cpu_variant() == BCM6361_CPU_ID)
  41. #define BCMCPU_VARIANT_IS_6362() \
  42. (bcm63xx_get_cpu_variant() == BCM6362_CPU_ID)
  43. #define BCMCPU_VARIANT_IS_6368() \