brcm.patch 3.0 KB

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