ar7.patch 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. diff -Nur linux-2.6.33.1.orig/arch/mips/ar7/platform.c linux-2.6.33.1/arch/mips/ar7/platform.c
  2. --- linux-2.6.33.1.orig/arch/mips/ar7/platform.c 2010-03-15 17:09:39.000000000 +0100
  3. +++ linux-2.6.33.1/arch/mips/ar7/platform.c 2010-03-28 19:26:53.000000000 +0200
  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.33.1.orig/arch/mips/ar7/prom.c linux-2.6.33.1/arch/mips/ar7/prom.c
  20. --- linux-2.6.33.1.orig/arch/mips/ar7/prom.c 2010-03-15 17:09:39.000000000 +0100
  21. +++ linux-2.6.33.1/arch/mips/ar7/prom.c 2010-03-28 19:26:53.000000000 +0200
  22. @@ -219,6 +219,14 @@
  23. if (strstr(prom_getcmdline(), "console="))
  24. return;
  25. +#ifdef CONFIG_KGDB
  26. + if (!strstr(prom_getcmdline(), "nokgdb")) {
  27. + strcat(prom_getcmdline(), " console=kgdb");
  28. + kgdb_enabled = 1;
  29. + return;
  30. + }
  31. +#endif
  32. +
  33. s = prom_getenv("modetty0");
  34. if (s) {
  35. baud = simple_strtoul(s, &p, 10);
  36. diff -Nur linux-2.6.33.1.orig/arch/mips/include/asm/page.h linux-2.6.33.1/arch/mips/include/asm/page.h
  37. --- linux-2.6.33.1.orig/arch/mips/include/asm/page.h 2010-03-15 17:09:39.000000000 +0100
  38. +++ linux-2.6.33.1/arch/mips/include/asm/page.h 2010-03-28 19:26:53.000000000 +0200
  39. @@ -200,8 +200,11 @@
  40. #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
  41. VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
  42. -#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE)
  43. -#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET)
  44. +#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE + \
  45. + PHYS_OFFSET)
  46. +#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET - \
  47. + PHYS_OFFSET)
  48. +
  49. #include <asm-generic/memory_model.h>
  50. #include <asm-generic/getorder.h>
  51. diff -Nur linux-2.6.33.1.orig/arch/mips/Kconfig linux-2.6.33.1/arch/mips/Kconfig
  52. --- linux-2.6.33.1.orig/arch/mips/Kconfig 2010-03-15 17:09:39.000000000 +0100
  53. +++ linux-2.6.33.1/arch/mips/Kconfig 2010-03-28 19:26:53.000000000 +0200
  54. @@ -34,7 +34,6 @@
  55. select CEVT_R4K
  56. select CSRC_R4K
  57. select IRQ_CPU
  58. - select NO_EXCEPT_FILL
  59. select SWAP_IO_SPACE
  60. select SYS_HAS_CPU_MIPS32_R1
  61. select SYS_HAS_EARLY_PRINTK
  62. diff -Nur linux-2.6.33.1.orig/arch/mips/kernel/traps.c linux-2.6.33.1/arch/mips/kernel/traps.c
  63. --- linux-2.6.33.1.orig/arch/mips/kernel/traps.c 2010-03-15 17:09:39.000000000 +0100
  64. +++ linux-2.6.33.1/arch/mips/kernel/traps.c 2010-03-28 19:26:53.000000000 +0200
  65. @@ -1283,9 +1283,22 @@
  66. exception_handlers[n] = handler;
  67. if (n == 0 && cpu_has_divec) {
  68. - *(u32 *)(ebase + 0x200) = 0x08000000 |
  69. - (0x03ffffff & (handler >> 2));
  70. - local_flush_icache_range(ebase + 0x200, ebase + 0x204);
  71. + if ((handler ^ (ebase + 4)) & 0xfc000000) {
  72. + /* lui k0, 0x0000 */
  73. + *(u32 *)(ebase + 0x200) = 0x3c1a0000 | (handler >> 16);
  74. + /* ori k0, 0x0000 */
  75. + *(u32 *)(ebase + 0x204) =
  76. + 0x375a0000 | (handler & 0xffff);
  77. + /* jr k0 */
  78. + *(u32 *)(ebase + 0x208) = 0x03400008;
  79. + /* nop */
  80. + *(u32 *)(ebase + 0x20C) = 0x00000000;
  81. + flush_icache_range(ebase + 0x200, ebase + 0x210);
  82. + } else {
  83. + *(u32 *)(ebase + 0x200) =
  84. + 0x08000000 | (0x03ffffff & (handler >> 2));
  85. + flush_icache_range(ebase + 0x200, ebase + 0x204);
  86. + }
  87. }
  88. return (void *)old_handler;
  89. }
  90. diff -Nur linux-2.6.33.1.orig/drivers/mtd/ar7part.c linux-2.6.33.1/drivers/mtd/ar7part.c
  91. --- linux-2.6.33.1.orig/drivers/mtd/ar7part.c 2010-03-15 17:09:39.000000000 +0100
  92. +++ linux-2.6.33.1/drivers/mtd/ar7part.c 2010-03-28 19:26:53.000000000 +0200
  93. @@ -28,7 +28,7 @@
  94. #include <linux/bootmem.h>
  95. #include <linux/magic.h>
  96. -#define AR7_PARTS 4
  97. +#define AR7_PARTS 5
  98. #define ROOT_OFFSET 0xe0000
  99. #define LOADER_MAGIC1 le32_to_cpu(0xfeedfa42)
  100. @@ -122,14 +122,19 @@
  101. ar7_parts[2].name = "linux";
  102. ar7_parts[2].offset = pre_size;
  103. - ar7_parts[2].size = master->size - pre_size - post_size;
  104. + ar7_parts[2].size = master->size - pre_size - post_size - 2*master->erasesize;
  105. ar7_parts[2].mask_flags = 0;
  106. ar7_parts[3].name = "rootfs";
  107. ar7_parts[3].offset = root_offset;
  108. - ar7_parts[3].size = master->size - root_offset - post_size;
  109. + ar7_parts[3].size = master->size - root_offset - post_size - 2*master->erasesize;
  110. ar7_parts[3].mask_flags = 0;
  111. + ar7_parts[4].name = "cfgfs";
  112. + ar7_parts[4].offset = master->size - 2*master->erasesize;
  113. + ar7_parts[4].size = 2*master->erasesize;
  114. + ar7_parts[4].mask_flags = 0;
  115. +
  116. *pparts = ar7_parts;
  117. return AR7_PARTS;
  118. }
  119. diff -Nur linux-2.6.33.1.orig/drivers/mtd/maps/physmap.c linux-2.6.33.1/drivers/mtd/maps/physmap.c
  120. --- linux-2.6.33.1.orig/drivers/mtd/maps/physmap.c 2010-03-15 17:09:39.000000000 +0100
  121. +++ linux-2.6.33.1/drivers/mtd/maps/physmap.c 2010-03-28 19:26:53.000000000 +0200
  122. @@ -79,7 +79,7 @@
  123. "map_rom",
  124. NULL };
  125. #ifdef CONFIG_MTD_PARTITIONS
  126. -static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
  127. +static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", "ar7part", NULL };
  128. #endif
  129. static int physmap_flash_probe(struct platform_device *dev)
  130. diff -Nur linux-2.6.33.1.orig/drivers/serial/8250.c linux-2.6.33.1/drivers/serial/8250.c
  131. --- linux-2.6.33.1.orig/drivers/serial/8250.c 2010-03-15 17:09:39.000000000 +0100
  132. +++ linux-2.6.33.1/drivers/serial/8250.c 2010-03-28 19:26:53.000000000 +0200
  133. @@ -2715,7 +2715,11 @@
  134. {
  135. struct uart_8250_port *up = (struct uart_8250_port *)port;
  136. +#ifdef CONFIG_AR7
  137. + wait_for_xmitr(up, BOTH_EMPTY);
  138. +#else
  139. wait_for_xmitr(up, UART_LSR_THRE);
  140. +#endif
  141. serial_out(up, UART_TX, ch);
  142. }