brcm.patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. diff -Nur linux-2.6.36.orig/arch/mips/bcm47xx/Makefile linux-2.6.36/arch/mips/bcm47xx/Makefile
  2. --- linux-2.6.36.orig/arch/mips/bcm47xx/Makefile 2010-10-20 22:30:22.000000000 +0200
  3. +++ linux-2.6.36/arch/mips/bcm47xx/Makefile 2010-12-22 16:39:15.000000000 +0100
  4. @@ -3,4 +3,4 @@
  5. # under Linux.
  6. #
  7. -obj-y := gpio.o irq.o nvram.o prom.o serial.o setup.o time.o wgt634u.o
  8. +obj-y := gpio.o irq.o nvram.o prom.o serial.o setup.o time.o platform.o
  9. diff -Nur linux-2.6.36.orig/arch/mips/bcm47xx/platform.c linux-2.6.36/arch/mips/bcm47xx/platform.c
  10. --- linux-2.6.36.orig/arch/mips/bcm47xx/platform.c 1970-01-01 01:00:00.000000000 +0100
  11. +++ linux-2.6.36/arch/mips/bcm47xx/platform.c 2010-12-22 16:57:43.000000000 +0100
  12. @@ -0,0 +1,81 @@
  13. +/*
  14. + * This file is subject to the terms and conditions of the GNU General Public
  15. + * License. See the file "COPYING" in the main directory of this archive
  16. + * for more details.
  17. + *
  18. + * Copyright (C) 2010 Waldemar Brodkorb <wbx@openadk.org>
  19. + */
  20. +
  21. +#include <linux/platform_device.h>
  22. +#include <linux/module.h>
  23. +#include <linux/mtd/physmap.h>
  24. +#include <linux/ssb/ssb.h>
  25. +
  26. +#include <asm/mach-bcm47xx/bcm47xx.h>
  27. +#include <asm/mach-bcm47xx/nvram.h>
  28. +
  29. +#define NVRAM_FLASH_SIZE 0x10000
  30. +
  31. +static struct mtd_partition bcm47xx_partitions[] = {
  32. + {
  33. + .name = "cfe",
  34. + .offset = 0,
  35. + .size = 0x40000, /* 256k */
  36. + .mask_flags = MTD_WRITEABLE /* force read-only */
  37. + },
  38. + {
  39. + .name = "linux",
  40. + .offset = 0,
  41. + .size = 0,
  42. + },
  43. + {
  44. + .name = "nvram",
  45. + .offset = 0,
  46. + .size = 0,
  47. + },
  48. +};
  49. +
  50. +static struct physmap_flash_data bcm47xx_flash_data = {
  51. + .parts = bcm47xx_partitions,
  52. + .nr_parts = ARRAY_SIZE(bcm47xx_partitions)
  53. +};
  54. +
  55. +static struct resource bcm47xx_flash_resource = {
  56. + .flags = IORESOURCE_MEM,
  57. +};
  58. +
  59. +static struct platform_device bcm47xx_flash = {
  60. + .name = "physmap-flash",
  61. + .id = 0,
  62. + .dev = { .platform_data = &bcm47xx_flash_data, },
  63. + .resource = &bcm47xx_flash_resource,
  64. + .num_resources = 1,
  65. +};
  66. +
  67. +static struct platform_device *bcm47xx_devices[] __initdata = {
  68. + &bcm47xx_flash,
  69. +};
  70. +
  71. +static int __init bcm47xx_register_devices(void)
  72. +{
  73. + u32 flash_size;
  74. + struct ssb_mipscore *mcore = &ssb_bcm47xx.mipscore;
  75. +
  76. + /* devices might have 2, 4 or 8 MB flash size */
  77. + flash_size = mcore->flash_window_size;
  78. + printk(KERN_INFO "FLASH SIZE: %x\n", flash_size);
  79. + bcm47xx_partitions[1].offset = 0x40000;
  80. + bcm47xx_partitions[1].size = flash_size - NVRAM_FLASH_SIZE - 0x40000;
  81. + bcm47xx_partitions[2].offset = flash_size - NVRAM_FLASH_SIZE;
  82. + bcm47xx_partitions[2].size = NVRAM_FLASH_SIZE;
  83. +
  84. + bcm47xx_flash_data.width = mcore->flash_buswidth;
  85. + bcm47xx_flash_resource.start = mcore->flash_window;
  86. + bcm47xx_flash_resource.end = mcore->flash_window
  87. + + mcore->flash_window_size
  88. + - 1;
  89. + return platform_add_devices(bcm47xx_devices,
  90. + ARRAY_SIZE(bcm47xx_devices));
  91. +}
  92. +
  93. +device_initcall(bcm47xx_register_devices);
  94. diff -Nur linux-2.6.36.orig/drivers/ssb/driver_mipscore.c linux-2.6.36/drivers/ssb/driver_mipscore.c
  95. --- linux-2.6.36.orig/drivers/ssb/driver_mipscore.c 2010-10-20 22:30:22.000000000 +0200
  96. +++ linux-2.6.36/drivers/ssb/driver_mipscore.c 2010-12-22 16:38:53.000000000 +0100
  97. @@ -193,7 +193,7 @@
  98. mcore->flash_buswidth = 2;
  99. if (bus->chipco.dev) {
  100. mcore->flash_window = 0x1c000000;
  101. - mcore->flash_window_size = 0x02000000;
  102. + mcore->flash_window_size = 0x00800000;
  103. if ((ssb_read32(bus->chipco.dev, SSB_CHIPCO_FLASH_CFG)
  104. & SSB_CHIPCO_CFG_DS16) == 0)
  105. mcore->flash_buswidth = 1;