1
0

ar7.patch 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. diff -Nur linux-2.6.32.orig/arch/mips/ar7/platform.c linux-2.6.32/arch/mips/ar7/platform.c
  2. --- linux-2.6.32.orig/arch/mips/ar7/platform.c 2009-12-03 04:51:21.000000000 +0100
  3. +++ linux-2.6.32/arch/mips/ar7/platform.c 2009-12-16 20:10:47.564817191 +0100
  4. @@ -509,7 +509,7 @@
  5. memset(uart_port, 0, sizeof(struct uart_port) * 2);
  6. - uart_port[0].type = PORT_16550A;
  7. + uart_port[0].type = PORT_AR7;
  8. uart_port[0].line = 0;
  9. uart_port[0].irq = AR7_IRQ_UART0;
  10. uart_port[0].uartclk = ar7_bus_freq() / 2;
  11. @@ -524,7 +524,7 @@
  12. /* Only TNETD73xx have a second serial port */
  13. if (ar7_has_second_uart()) {
  14. - uart_port[1].type = PORT_16550A;
  15. + uart_port[1].type = PORT_AR7;
  16. uart_port[1].line = 1;
  17. uart_port[1].irq = AR7_IRQ_UART1;
  18. uart_port[1].uartclk = ar7_bus_freq() / 2;
  19. diff -Nur linux-2.6.32.orig/arch/mips/include/asm/page.h linux-2.6.32/arch/mips/include/asm/page.h
  20. --- linux-2.6.32.orig/arch/mips/include/asm/page.h 2009-12-03 04:51:21.000000000 +0100
  21. +++ linux-2.6.32/arch/mips/include/asm/page.h 2009-12-16 20:10:47.576432079 +0100
  22. @@ -200,8 +200,11 @@
  23. #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
  24. VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
  25. -#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE)
  26. -#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET)
  27. +#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE + \
  28. + PHYS_OFFSET)
  29. +#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET - \
  30. + PHYS_OFFSET)
  31. +
  32. #include <asm-generic/memory_model.h>
  33. #include <asm-generic/getorder.h>
  34. diff -Nur linux-2.6.32.orig/arch/mips/Kconfig linux-2.6.32/arch/mips/Kconfig
  35. --- linux-2.6.32.orig/arch/mips/Kconfig 2009-12-14 21:11:40.737752912 +0100
  36. +++ linux-2.6.32/arch/mips/Kconfig 2009-12-16 20:10:47.592420151 +0100
  37. @@ -30,7 +30,6 @@
  38. select CEVT_R4K
  39. select CSRC_R4K
  40. select IRQ_CPU
  41. - select NO_EXCEPT_FILL
  42. select SWAP_IO_SPACE
  43. select SYS_HAS_CPU_MIPS32_R1
  44. select SYS_HAS_EARLY_PRINTK
  45. diff -Nur linux-2.6.32.orig/arch/mips/kernel/traps.c linux-2.6.32/arch/mips/kernel/traps.c
  46. --- linux-2.6.32.orig/arch/mips/kernel/traps.c 2009-12-03 04:51:21.000000000 +0100
  47. +++ linux-2.6.32/arch/mips/kernel/traps.c 2009-12-16 20:10:47.596422057 +0100
  48. @@ -1255,9 +1255,22 @@
  49. exception_handlers[n] = handler;
  50. if (n == 0 && cpu_has_divec) {
  51. - *(u32 *)(ebase + 0x200) = 0x08000000 |
  52. - (0x03ffffff & (handler >> 2));
  53. - local_flush_icache_range(ebase + 0x200, ebase + 0x204);
  54. + if ((handler ^ (ebase + 4)) & 0xfc000000) {
  55. + /* lui k0, 0x0000 */
  56. + *(u32 *)(ebase + 0x200) = 0x3c1a0000 | (handler >> 16);
  57. + /* ori k0, 0x0000 */
  58. + *(u32 *)(ebase + 0x204) =
  59. + 0x375a0000 | (handler & 0xffff);
  60. + /* jr k0 */
  61. + *(u32 *)(ebase + 0x208) = 0x03400008;
  62. + /* nop */
  63. + *(u32 *)(ebase + 0x20C) = 0x00000000;
  64. + flush_icache_range(ebase + 0x200, ebase + 0x210);
  65. + } else {
  66. + *(u32 *)(ebase + 0x200) =
  67. + 0x08000000 | (0x03ffffff & (handler >> 2));
  68. + flush_icache_range(ebase + 0x200, ebase + 0x204);
  69. + }
  70. }
  71. return (void *)old_handler;
  72. }
  73. diff -Nur linux-2.6.32.orig/drivers/mtd/ar7part.c linux-2.6.32/drivers/mtd/ar7part.c
  74. --- linux-2.6.32.orig/drivers/mtd/ar7part.c 2009-12-03 04:51:21.000000000 +0100
  75. +++ linux-2.6.32/drivers/mtd/ar7part.c 2009-12-17 10:51:32.044434005 +0100
  76. @@ -28,7 +28,7 @@
  77. #include <linux/bootmem.h>
  78. #include <linux/magic.h>
  79. -#define AR7_PARTS 4
  80. +#define AR7_PARTS 5
  81. #define ROOT_OFFSET 0xe0000
  82. #define LOADER_MAGIC1 le32_to_cpu(0xfeedfa42)
  83. @@ -122,14 +122,19 @@
  84. ar7_parts[2].name = "linux";
  85. ar7_parts[2].offset = pre_size;
  86. - ar7_parts[2].size = master->size - pre_size - post_size;
  87. + ar7_parts[2].size = master->size - pre_size - post_size - 2*master->erasesize;
  88. ar7_parts[2].mask_flags = 0;
  89. ar7_parts[3].name = "rootfs";
  90. ar7_parts[3].offset = root_offset;
  91. - ar7_parts[3].size = master->size - root_offset - post_size;
  92. + ar7_parts[3].size = master->size - root_offset - post_size - 2*master->erasesize;
  93. ar7_parts[3].mask_flags = 0;
  94. + ar7_parts[4].name = "cfgfs";
  95. + ar7_parts[4].offset = master->size - 2*master->erasesize;
  96. + ar7_parts[4].size = 2*master->erasesize;
  97. + ar7_parts[4].mask_flags = 0;
  98. +
  99. *pparts = ar7_parts;
  100. return AR7_PARTS;
  101. }
  102. diff -Nur linux-2.6.32.orig/drivers/mtd/maps/physmap.c linux-2.6.32/drivers/mtd/maps/physmap.c
  103. --- linux-2.6.32.orig/drivers/mtd/maps/physmap.c 2009-12-03 04:51:21.000000000 +0100
  104. +++ linux-2.6.32/drivers/mtd/maps/physmap.c 2009-12-16 20:12:01.388510102 +0100
  105. @@ -80,7 +80,7 @@
  106. "map_rom",
  107. NULL };
  108. #ifdef CONFIG_MTD_PARTITIONS
  109. -static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
  110. +static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", "ar7part", NULL };
  111. #endif
  112. static int physmap_flash_probe(struct platform_device *dev)
  113. diff -Nur linux-2.6.32.orig/drivers/net/cpmac.c linux-2.6.32/drivers/net/cpmac.c
  114. --- linux-2.6.32.orig/drivers/net/cpmac.c 2009-12-03 04:51:21.000000000 +0100
  115. +++ linux-2.6.32/drivers/net/cpmac.c 2009-12-16 21:24:20.356422767 +0100
  116. @@ -1165,7 +1165,7 @@
  117. priv->dev = dev;
  118. priv->ring_size = 64;
  119. priv->msg_enable = netif_msg_init(debug_level, 0xff);
  120. - memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr));
  121. + memcpy(dev->dev_addr, pdata->dev_addr, ETH_ALEN);
  122. snprintf(priv->phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id);
  123. diff -Nur linux-2.6.32.orig/drivers/serial/8250.c linux-2.6.32/drivers/serial/8250.c
  124. --- linux-2.6.32.orig/drivers/serial/8250.c 2009-12-03 04:51:21.000000000 +0100
  125. +++ linux-2.6.32/drivers/serial/8250.c 2009-12-16 20:10:58.820421544 +0100
  126. @@ -2714,7 +2714,11 @@
  127. {
  128. struct uart_8250_port *up = (struct uart_8250_port *)port;
  129. +#ifdef CONFIG_AR7
  130. + wait_for_xmitr(up, BOTH_EMPTY);
  131. +#else
  132. wait_for_xmitr(up, UART_LSR_THRE);
  133. +#endif
  134. serial_out(up, UART_TX, ch);
  135. }