Changeset 18294
- Timestamp:
- 01/24/12 04:51:45 (16 months ago)
- Location:
- src/linux/universal/linux-3.2
- Files:
-
- 9 added
- 6 deleted
- 24 edited
-
.config_hornet (added)
-
arch/mips/Kconfig (modified) (1 diff)
-
arch/mips/Makefile (modified) (1 diff)
-
arch/mips/ar7240/Makefile (modified) (2 diffs)
-
arch/mips/ar7240/ar71xx.c (modified) (3 diffs)
-
arch/mips/ar7240/dev-ap91-pci.c (modified) (2 diffs)
-
arch/mips/ar7240/dev-ar9xxx-wmac.c (added)
-
arch/mips/ar7240/dev-ar9xxx-wmac.h (added)
-
arch/mips/ar7240/early_printk.c (added)
-
arch/mips/ar7240/gpio_driver.c (modified) (3 diffs)
-
arch/mips/ar7240/irq.c (modified) (1 diff)
-
arch/mips/ar7240/pci-ath9k-fixup.c (modified) (2 diffs)
-
arch/mips/ar7240/pci.c (modified) (2 diffs)
-
arch/mips/ar7240/platform.c (modified) (6 diffs)
-
arch/mips/ar7240/prom.c (modified) (1 diff)
-
arch/mips/ar7240/setup.c (modified) (16 diffs)
-
arch/mips/include/asm/mach-ar7100/cpu-feature-overri (deleted)
-
arch/mips/include/asm/mach-ar7100/kernel-entry-init. (deleted)
-
arch/mips/include/asm/mach-ar71xx/ar71xx.h (modified) (1 diff)
-
arch/mips/include/asm/mach-ar71xx/ar933x_uart.h (added)
-
arch/mips/include/asm/mach-ar71xx/ar933x_uart_platform.h (added)
-
arch/mips/include/asm/mach-ar71xx/cpu-feature-overri (deleted)
-
arch/mips/include/asm/mach-ar71xx/kernel-entry-init. (deleted)
-
arch/mips/include/asm/mach-ar7240/ar7240.h (modified) (5 diffs)
-
arch/mips/include/asm/mach-ar7240/ar933x.h (added)
-
arch/mips/include/asm/mach-ar7240/ar934x.h (added)
-
arch/mips/include/asm/mach-ar7240/cpu-feature-overri (deleted)
-
arch/mips/include/asm/mach-ar7240/kernel-entry-init. (deleted)
-
drivers/mtd/devices/Kconfig (modified) (2 diffs)
-
drivers/mtd/maps/Makefile (modified) (1 diff)
-
drivers/net/ethernet/ag7240/ag7240.c (modified) (9 diffs)
-
drivers/net/ethernet/ag7240/ag7240_phy.h (modified) (2 diffs)
-
drivers/tty/serial/Kconfig (modified) (1 diff)
-
drivers/tty/serial/Makefile (modified) (1 diff)
-
drivers/tty/serial/ar933x_uart.c (added)
-
drivers/usb/Kconfig (modified) (1 diff)
-
drivers/usb/host/ehci-ar71xx.c (modified) (1 diff)
-
include/linux/serial_core.h (modified) (1 diff)
-
init/main.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/linux/universal/linux-3.2/arch/mips/Kconfig
r18226 r18294 785 785 Say Y here if you have a XLR or XLS based board. 786 786 787 config MACH_HORNET 788 bool "Support for Atheros HORNET based board" 789 select DMA_NONCOHERENT 790 select IRQ_CPU 791 select CEVT_R4K 792 select CSRC_R4K 793 select DMA_NONCOHERENT 794 select ARCH_REQUIRE_GPIOLIB 795 select SYS_HAS_CPU_MIPS32_R1 796 select SYS_HAS_CPU_MIPS32_R2 797 select SYS_SUPPORTS_32BIT_KERNEL 798 select SYS_SUPPORTS_BIG_ENDIAN 799 select SYS_HAS_EARLY_PRINTK 800 801 config HORNET_EMULATION 802 bool "build system for Hornet emulation board?" 803 depends on MACH_HORNET 804 787 805 config MACH_AR7100 788 806 bool "Support for Atheros ar7100 based boards" -
src/linux/universal/linux-3.2/arch/mips/Makefile
r18171 r18294 187 187 endif 188 188 189 #Atheros Ar9330(Hornet) 190 # 191 core-$(CONFIG_MACH_HORNET) += arch/mips/ar7240/ 192 load-$(CONFIG_MACH_HORNET) += 0xffffffff80002000 193 cflags-$(CONFIG_MACH_HORNET) += -I$(srctree)/arch/mips/include/asm/mach-ar7240 194 195 189 196 #Atheros Ar7240 190 197 # -
src/linux/universal/linux-3.2/arch/mips/ar7240/Makefile
r18171 r18294 26 26 gpio_driver.o \ 27 27 dev-leds-gpio.o \ 28 dev-ar9xxx-wmac.o \ 28 29 ar7240.o \ 29 30 ar71xx.o \ … … 34 35 platform.o 35 36 37 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 36 38 #obj-$(CONFIG_AR9100) += wdt.o 37 39 -
src/linux/universal/linux-3.2/arch/mips/ar7240/ar71xx.c
r18171 r18294 72 72 break; 73 73 74 case AR71XX_SOC_AR9330: 75 case AR71XX_SOC_AR9331: 76 spin_lock_irqsave(&ar71xx_device_lock, flags); 77 t = ar71xx_reset_rr(AR933X_RESET_REG_RESET_MODULE); 78 ar71xx_reset_wr(AR933X_RESET_REG_RESET_MODULE, t | mask); 79 spin_unlock_irqrestore(&ar71xx_device_lock, flags); 80 break; 81 82 case AR71XX_SOC_AR9341: 83 case AR71XX_SOC_AR9342: 84 case AR71XX_SOC_AR9344: 85 spin_lock_irqsave(&ar71xx_device_lock, flags); 86 t = ar71xx_reset_rr(AR934X_RESET_REG_RESET_MODULE); 87 ar71xx_reset_wr(AR934X_RESET_REG_RESET_MODULE, t | mask); 88 spin_unlock_irqrestore(&ar71xx_device_lock, flags); 89 break; 90 74 91 default: 75 92 BUG(); … … 113 130 spin_unlock_irqrestore(&ar71xx_device_lock, flags); 114 131 break; 132 case AR71XX_SOC_AR9330: 133 case AR71XX_SOC_AR9331: 134 spin_lock_irqsave(&ar71xx_device_lock, flags); 135 t = ar71xx_reset_rr(AR933X_RESET_REG_RESET_MODULE); 136 ar71xx_reset_wr(AR933X_RESET_REG_RESET_MODULE, t & ~mask); 137 spin_unlock_irqrestore(&ar71xx_device_lock, flags); 138 break; 139 140 case AR71XX_SOC_AR9341: 141 case AR71XX_SOC_AR9342: 142 case AR71XX_SOC_AR9344: 143 spin_lock_irqsave(&ar71xx_device_lock, flags); 144 t = ar71xx_reset_rr(AR934X_RESET_REG_RESET_MODULE); 145 ar71xx_reset_wr(AR934X_RESET_REG_RESET_MODULE, t & ~mask); 146 spin_unlock_irqrestore(&ar71xx_device_lock, flags); 147 break; 115 148 116 149 default: … … 149 182 break; 150 183 184 case AR71XX_SOC_AR9330: 185 case AR71XX_SOC_AR9331: 186 spin_lock_irqsave(&ar71xx_device_lock, flags); 187 t = ar71xx_reset_rr(AR933X_RESET_REG_RESET_MODULE); 188 spin_unlock_irqrestore(&ar71xx_device_lock, flags); 189 break; 190 191 case AR71XX_SOC_AR9341: 192 case AR71XX_SOC_AR9342: 193 case AR71XX_SOC_AR9344: 194 spin_lock_irqsave(&ar71xx_device_lock, flags); 195 t = ar71xx_reset_rr(AR934X_RESET_REG_RESET_MODULE); 196 spin_unlock_irqrestore(&ar71xx_device_lock, flags); 197 break; 198 199 151 200 default: 152 201 BUG(); -
src/linux/universal/linux-3.2/arch/mips/ar7240/dev-ap91-pci.c
r18171 r18294 8 8 * by the Free Software Foundation. 9 9 */ 10 10 #ifndef CONFIG_MACH_HORNET 11 11 #include <linux/pci.h> 12 12 #include <linux/ath9k_platform.h> … … 70 70 pci_enable_ath9k_fixup(0, wmac_data.eeprom_data); 71 71 } 72 #endif -
src/linux/universal/linux-3.2/arch/mips/ar7240/gpio_driver.c
r18171 r18294 327 327 328 328 //wl gpios 329 329 #ifndef CONFIG_MACH_HORNET 330 330 331 331 { … … 491 491 }, 492 492 #endif 493 #endif 493 494 }; 494 495 496 void serial_print(char *fmt, ...); 495 497 496 498 void __init ar71xx_gpio_init(void) … … 502 504 panic("cannot allocate AR71xx GPIO registers page"); 503 505 504 ar71xx_gpio_chip.ngpio = 48;506 ar71xx_gpio_chip.ngpio = sizeof(generic_leds_gpio)/sizeof(struct gpio_led); 505 507 506 508 err = gpiochip_add(&ar71xx_gpio_chip); -
src/linux/universal/linux-3.2/arch/mips/ar7240/irq.c
r18171 r18294 60 60 // setup_irq(AR7240_CPU_IRQ_PCI, &cascade); 61 61 #endif 62 #if def CONFIG_WASP_SUPPORT63 set_irq_chip_and_handler(ATH_CPU_IRQ_WLAN,62 #if defined(CONFIG_WASP_SUPPORT) || defined(CONFIG_MACH_HORNET) 63 irq_set_chip_and_handler(ATH_CPU_IRQ_WLAN, 64 64 &dummy_irq_chip, 65 65 handle_percpu_irq); -
src/linux/universal/linux-3.2/arch/mips/ar7240/pci-ath9k-fixup.c
r18171 r18294 8 8 * by the Free Software Foundation. 9 9 */ 10 10 #ifndef CONFIG_MACH_HORNET 11 11 #include <linux/pci.h> 12 12 #include <linux/delay.h> … … 155 155 ath9k_num_fixups++; 156 156 } 157 #endif -
src/linux/universal/linux-3.2/arch/mips/ar7240/pci.c
r18171 r18294 19 19 #include <asm/mach-ar71xx/pci.h> 20 20 21 #ifndef CONFIG_MACH_HORNET 21 22 unsigned ar71xx_pci_nr_irqs __initdata; 22 23 struct ar71xx_pci_irq *ar71xx_pci_irq_map __initdata; … … 92 93 return ret; 93 94 } 95 #endif -
src/linux/universal/linux-3.2/arch/mips/ar7240/platform.c
r18171 r18294 16 16 #include <asm/mach-ar71xx/ar71xx.h> 17 17 #include "nvram.h" 18 #include <asm/mach-ar71xx/ar933x_uart_platform.h> 19 20 void serial_print(char *fmt, ...); 18 21 19 22 #ifdef CONFIG_WASP_SUPPORT … … 119 122 }; 120 123 124 125 static struct resource ar933x_uart_resources[] = { 126 { 127 .start = AR933X_UART_BASE, 128 .end = AR933X_UART_BASE + AR71XX_UART_SIZE - 1, 129 .flags = IORESOURCE_MEM, 130 }, 131 { 132 .start = AR7240_MISC_IRQ_UART, 133 .end = AR7240_MISC_IRQ_UART, 134 .flags = IORESOURCE_IRQ, 135 }, 136 }; 137 138 static struct ar933x_uart_platform_data ar933x_uart_data; 139 static struct platform_device ar933x_uart_device = { 140 .name = "ar933x-uart", 141 .id = -1, 142 .resource = ar933x_uart_resources, 143 .num_resources = ARRAY_SIZE(ar933x_uart_resources), 144 .dev = { 145 .platform_data = &ar933x_uart_data, 146 }, 147 }; 148 149 static struct resource ath_uart_resources[] = { 150 { 151 .start = AR933X_UART_BASE, 152 .end = AR933X_UART_BASE + 0x0fff, 153 .flags = IORESOURCE_MEM, 154 }, 155 }; 156 157 static struct plat_serial8250_port ath_uart_data[] = { 158 { 159 .mapbase = (u32) KSEG1ADDR(AR933X_UART_BASE), 160 .membase = (void __iomem *)((u32) (KSEG1ADDR(AR933X_UART_BASE))), 161 .irq = AR7240_MISC_IRQ_UART, 162 .flags = (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST), 163 .iotype = UPIO_MEM32, 164 .regshift = 2, 165 .uartclk = 0, /* ath_ahb_freq, */ 166 }, 167 {}, 168 }; 169 170 static struct platform_device ath_uart = { 171 .name = "serial8250", 172 .id = 0, 173 .dev.platform_data = ath_uart_data, 174 .num_resources = 1, 175 .resource = ath_uart_resources 176 }; 177 178 179 121 180 static struct platform_device *ar7241_platform_devices[] __initdata = { 122 181 &ar7240_usb_ehci_device … … 128 187 129 188 static struct platform_device *ar724x_platform_devices[] __initdata = { 189 #ifdef CONFIG_MACH_HORNET 190 &ar933x_uart_device, 191 &ath_uart 192 #else 130 193 &ar7240_uart 194 #endif 131 195 }; 132 196 133 197 extern __init ap91_pci_init(u8 *cal_data, u8 *mac_addr); 198 void ar9xxx_add_device_wmac(u8 *cal_data, u8 *mac_addr) __init; 134 199 135 200 static void *getCalData(int slot) … … 177 242 178 243 /* need to set clock appropriately */ 244 #ifdef CONFIG_MACH_HORNET 245 // ath_uart_data[0].uartclk = ar7240_ahb_freq; 246 // ar933x_uart_data.uartclk = ar7240_ahb_freq; 247 248 ath_uart_data[0].uartclk = ar71xx_ref_freq; 249 ar933x_uart_data.uartclk = ar71xx_ref_freq; 250 #endif 251 179 252 #ifdef CONFIG_WASP_SUPPORT 180 253 ar7240_uart_data[0].uartclk = ath_ref_clk_freq; … … 188 261 return ret; 189 262 190 if (is_ar7241() || is_ar7242() || is_ar933 0() || is_wasp()) {263 if (is_ar7241() || is_ar7242() || is_ar933x() || is_wasp()) { 191 264 ret = platform_add_devices(ar7241_platform_devices, 192 265 ARRAY_SIZE(ar7241_platform_devices)); … … 197 270 } 198 271 272 #ifdef CONFIG_MACH_HORNET 273 ee = (u8 *) KSEG1ADDR(0x1fff1000); 274 ar9xxx_add_device_wmac(ee, NULL); 275 #else 199 276 ee = getCalData(0); 200 277 ap91_pci_init(ee, mac); 278 #endif 201 279 return ret; 202 280 } -
src/linux/universal/linux-3.2/arch/mips/ar7240/prom.c
r18171 r18294 17 17 18 18 int __ath_flash_size; 19 20 extern void Uart16550Put(unsigned char byte);21 22 #define UART_READ(r) \23 __raw_readl((void __iomem *)(KSEG1ADDR(AR7240_UART_BASE) + 4 * (r)))24 25 #define UART_WRITE(r, v) \26 __raw_writel((v), (void __iomem *)(KSEG1ADDR(AR7240_UART_BASE) + 4*(r)))27 28 void prom_putchar(unsigned char ch)29 {30 while (((UART_READ(UART_LSR)) & UART_LSR_THRE) == 0);31 UART_WRITE(UART_TX, ch);32 while (((UART_READ(UART_LSR)) & UART_LSR_THRE) == 0);33 }34 19 35 20 -
src/linux/universal/linux-3.2/arch/mips/ar7240/setup.c
r18171 r18294 42 42 43 43 static int __init ar7240_init_ioc(void); 44 void Uart16550Init(void);45 44 void serial_print(char *fmt, ...); 46 45 void writeserial(char *str,int count); … … 50 49 static void ar7240_sys_frequency(void); 51 50 #endif 51 #ifdef CONFIG_MACH_HORNET 52 static void hornet_sys_frequency(void); 53 void UartHornetInit(void); 54 void UartHornetPut(u8 byte); 55 56 #define Uart16550Init UartHornetInit 57 #define Uart16550Put UartHornetPut 58 #else 59 void Uart16550Init(void); 52 60 u8 Uart16550GetPoll(void); 61 #endif 53 62 /* 54 63 * Export AHB freq value to be used by Ethernet MDIO. … … 141 150 rev = 1; 142 151 break; 152 case AR9330_REV_1_2: 153 chip = "9330"; 154 rev = 2; 155 break; 156 case AR9331_REV_1_0: 157 chip = "9331"; 158 rev = 0; 159 break; 160 case AR9331_REV_1_1: 161 chip = "9331"; 162 rev = 1; 163 break; 164 case AR9331_REV_1_2: 165 chip = "9331"; 166 rev = 2; 167 break; 143 168 case AR9344_REV_1_0: 144 169 chip = "9344"; … … 266 291 ar7240_sys_frequency(void) 267 292 { 268 293 #ifdef CONFIG_MACH_HORNET 294 hornet_sys_frequency(); 295 #else /* CONFIG_MACH_HORNET */ 269 296 #ifdef CONFIG_AR7240_EMULATION 270 297 #ifdef FB50 … … 304 331 ar7240_ahb_freq = ar7240_cpu_freq/ahb_div; 305 332 #endif 306 } 307 #endif 308 extern int early_serial_setup(struct uart_port *port); 309 310 #define AR71XX_UART_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP) 311 void __init 312 serial_setup(void) 313 { 314 struct uart_port p; 315 316 memset(&p, 0, sizeof(p)); 317 318 p.flags = AR71XX_UART_FLAGS; 319 p.iotype = UPIO_MEM32; 320 p.uartclk = ar7240_ahb_freq; 321 p.irq = AR7240_MISC_IRQ_UART; 322 p.regshift = 2; 323 p.membase = (u8 *)KSEG1ADDR(AR7240_UART_BASE); 324 325 if (early_serial_setup(&p) != 0) 326 printk(KERN_ERR "early_serial_setup failed\n"); 327 328 } 333 #endif 334 } 335 #endif 329 336 void __init plat_time_init(void) 330 337 { … … 397 404 #define AR71XX_MEM_SIZE_MIN 0x0200000 398 405 #define AR71XX_MEM_SIZE_MAX 0x8000000 399 406 static int ramsize; 400 407 static void __init ar71xx_detect_mem_size(void) 401 408 { … … 422 429 } 423 430 *p = memsave; 424 431 ramsize = size; 425 432 add_memory_region(0, size, BOOT_MEM_RAM); 426 433 } … … 437 444 } 438 445 439 446 #define AR71XX_REV_ID_REVISION_MASK 0x3 447 #define AR71XX_REV_ID_REVISION_SHIFT 2 448 #define AR933X_RESET_REG_BOOTSTRAP 0xac 449 #define AR933X_RESET_REG_BOOTSTRAP 0xac 450 #define AR933X_BOOTSTRAP_MDIO_GPIO_EN BIT(18) 451 #define AR933X_BOOTSTRAP_EEPBUSY BIT(4) 452 #define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0) 453 454 u32 ar71xx_soc_rev; 455 EXPORT_SYMBOL_GPL(ar71xx_soc_rev); 456 457 u32 ar71xx_ref_freq; 458 EXPORT_SYMBOL_GPL(ar71xx_ref_freq); 440 459 441 460 int is_ar9000; … … 443 462 void __init plat_mem_setup(void) 444 463 { 464 u32 id; 465 u32 t; 466 u32 rev=0; 445 467 446 468 if (is_ar7240()) { … … 450 472 }else if (is_ar7242()) { 451 473 ar71xx_soc = AR71XX_SOC_AR7242; 474 }else if (is_ar9330()) { 475 ar71xx_soc = AR71XX_SOC_AR9330; 476 }else if (is_ar9331()) { 477 ar71xx_soc = AR71XX_SOC_AR9331; 478 }else if (is_ar9341()) { 479 ar71xx_soc = AR71XX_SOC_AR9341; 480 }else if (is_ar9342()) { 481 ar71xx_soc = AR71XX_SOC_AR9342; 482 }else if (is_ar9344()) { 483 ar71xx_soc = AR71XX_SOC_AR9344; 452 484 } 485 id = ar7240_reg_rd(AR7240_REV_ID) & AR7240_REV_ID_MASK; 486 ar71xx_soc_rev = id >> AR71XX_REV_ID_REVISION_SHIFT; 487 ar71xx_soc_rev &= AR71XX_REV_ID_REVISION_MASK; 488 453 489 454 490 ar71xx_ddr_base = ioremap_nocache(AR71XX_DDR_CTRL_BASE, … … 465 501 ar71xx_usb_ctrl_base = ioremap_nocache(AR71XX_USB_CTRL_BASE, 466 502 AR71XX_USB_CTRL_SIZE); 503 504 505 506 #ifdef CONFIG_MACH_HORNET 507 if ( ar7240_reg_rd(HORNET_BOOTSTRAP_STATUS) & HORNET_BOOTSTRAP_SEL_25M_40M_MASK ) 508 ar71xx_ref_freq = (40 * 1000 * 1000); 509 else 510 ar71xx_ref_freq = (25 * 1000 * 1000); 511 #endif 467 512 468 513 #if 0 … … 489 534 Uart16550Init(); 490 535 #ifdef CONFIG_MACH_HORNET 491 serial_print("Booting AR9330(Hornet)...\n");536 serial_print("Booting %s(Hornet)...\n",get_system_type()); 492 537 /* clear wmac reset */ 493 538 ar7240_reg_wr(AR7240_RESET, (ar7240_reg_rd(AR7240_RESET) & (~AR7240_RESET_WMAC))); … … 510 555 511 556 #define REG_OFFSET 4 557 558 static int serial_inited = 0; 559 560 #define MY_WRITE(y, z) ((*((volatile u32*)(y))) = z) 561 562 #ifndef CONFIG_MACH_HORNET 512 563 513 564 /* === END OF CONFIG === */ … … 534 585 #define UART16550_WRITE(x, z) ar7240_reg_wr((AR7240_UART_BASE+x), z) 535 586 536 static int serial_inited = 0;537 538 #define MY_WRITE(y, z) ((*((volatile u32*)(y))) = z)539 587 540 588 void Uart16550Init() … … 600 648 UART16550_WRITE(OFS_SEND_BUFFER, byte); 601 649 } 602 650 #endif 603 651 extern int vsprintf(char *buf, const char *fmt, va_list args); 604 652 static char sprint_buf[1024]; … … 631 679 return ar7240_cpu_freq/1000000; 632 680 } 633 681 #ifdef CONFIG_MACH_HORNET 682 683 void UartHornetInit(void) 684 { 685 unsigned int rdata; 686 unsigned int baudRateDivisor, clock_step; 687 unsigned int fcEnable = 0; 688 689 ar7240_sys_frequency(); 690 691 #if 0 692 MY_WRITE(0xb8040000, 0xcff); 693 MY_WRITE(0xb8040008, 0x3b); 694 /* Enable UART , SPI and Disable S26 UART */ 695 MY_WRITE(0xb8040028, (ar7240_reg_rd(0xb8040028) | 0x48002)); 696 697 MY_WRITE(0xb8040008, 0x2f); 698 #endif 699 #ifdef CONFIG_HORNET_EMULATION 700 baudRateDivisor = ( ar7240_ahb_freq / (16*AG7240_CONSOLE_BAUD) ) - 1; // 24 MHz clock is taken as UART clock 701 #else 702 703 rdata = ar7240_reg_rd(HORNET_BOOTSTRAP_STATUS); 704 rdata &= HORNET_BOOTSTRAP_SEL_25M_40M_MASK; 705 706 if (rdata) 707 baudRateDivisor = ( 40000000 / (16*AG7240_CONSOLE_BAUD) ) - 1; // 40 MHz clock is taken as UART clock 708 else 709 baudRateDivisor = ( 25000000 / (16*AG7240_CONSOLE_BAUD) ) - 1; // 25 MHz clock is taken as UART clock 710 #endif 711 712 clock_step = 8192; 713 714 rdata = UARTCLOCK_UARTCLOCKSCALE_SET(baudRateDivisor) | UARTCLOCK_UARTCLOCKSTEP_SET(clock_step); 715 uart_reg_write(UARTCLOCK_ADDRESS, rdata); 716 717 /* Config Uart Controller */ 718 #if 1 /* No interrupt */ 719 rdata = UARTCS_UARTDMAEN_SET(0) | UARTCS_UARTHOSTINTEN_SET(0) | UARTCS_UARTHOSTINT_SET(0) 720 | UARTCS_UARTSERIATXREADY_SET(0) | UARTCS_UARTTXREADYORIDE_SET(~fcEnable) 721 | UARTCS_UARTRXREADYORIDE_SET(~fcEnable) | UARTCS_UARTHOSTINTEN_SET(0); 722 #else 723 rdata = UARTCS_UARTDMAEN_SET(0) | UARTCS_UARTHOSTINTEN_SET(0) | UARTCS_UARTHOSTINT_SET(0) 724 | UARTCS_UARTSERIATXREADY_SET(0) | UARTCS_UARTTXREADYORIDE_SET(~fcEnable) 725 | UARTCS_UARTRXREADYORIDE_SET(~fcEnable) | UARTCS_UARTHOSTINTEN_SET(1); 726 #endif 727 728 /* is_dte == 1 */ 729 rdata = rdata | UARTCS_UARTINTERFACEMODE_SET(2); 730 731 if (fcEnable) { 732 rdata = rdata | UARTCS_UARTFLOWCONTROLMODE_SET(2); 733 } 734 735 /* invert_fc ==0 (Inverted Flow Control) */ 736 //rdata = rdata | UARTCS_UARTFLOWCONTROLMODE_SET(3); 737 738 /* parityEnable == 0 */ 739 //rdata = rdata | UARTCS_UARTPARITYMODE_SET(2); -->Parity Odd 740 //rdata = rdata | UARTCS_UARTPARITYMODE_SET(3); -->Parity Even 741 uart_reg_write(UARTCS_ADDRESS, rdata); 742 743 serial_inited = 1; 744 } 745 746 u8 UartHornetGetPoll(void) 747 { 748 u8 ret_val; 749 unsigned int rdata; 750 751 do { 752 rdata = uart_reg_read(UARTDATA_ADDRESS); 753 } while (!UARTDATA_UARTRXCSR_GET(rdata)); 754 755 ret_val = (u8)UARTDATA_UARTTXRXDATA_GET(rdata); 756 rdata = UARTDATA_UARTRXCSR_SET(1); 757 uart_reg_write(UARTDATA_ADDRESS, rdata); 758 759 return ret_val; 760 } 761 762 void UartHornetPut(u8 byte) 763 { 764 unsigned int rdata; 765 766 if (!serial_inited) { 767 serial_inited = 1; 768 UartHornetInit(); 769 } 770 771 do { 772 rdata = uart_reg_read(UARTDATA_ADDRESS); 773 } while (UARTDATA_UARTTXCSR_GET(rdata) == 0); 774 775 rdata = UARTDATA_UARTTXRXDATA_SET((unsigned int)byte); 776 rdata |= UARTDATA_UARTTXCSR_SET(1); 777 778 uart_reg_write(UARTDATA_ADDRESS, rdata); 779 } 780 781 static void 782 hornet_sys_frequency(void) 783 { 784 #ifdef CONFIG_HORNET_EMULATION 785 #ifdef CONFIG_HORNET_EMULATION_WLAN_HARDI /* FPGA WLAN emulation */ 786 ar7240_cpu_freq = 48000000; 787 ar7240_ddr_freq = 48000000; 788 ar7240_ahb_freq = 24000000; 789 #else 790 ar7240_cpu_freq = 80000000; 791 ar7240_ddr_freq = 80000000; 792 ar7240_ahb_freq = 40000000; 793 #endif 794 #else 795 /* Hornet's PLL is completely different from Python's */ 796 u32 ref_clock_rate, pll_freq; 797 u32 pllreg, clockreg; 798 u32 nint, refdiv, outdiv; 799 u32 cpu_div, ahb_div, ddr_div; 800 801 if ( ar7240_reg_rd(HORNET_BOOTSTRAP_STATUS) & HORNET_BOOTSTRAP_SEL_25M_40M_MASK ) 802 ref_clock_rate = 40 * 1000000; 803 else 804 ref_clock_rate = 25 * 1000000; 805 806 pllreg = ar7240_reg_rd(AR7240_CPU_PLL_CONFIG); 807 clockreg = ar7240_reg_rd(AR7240_CPU_CLOCK_CONTROL); 808 809 if (clockreg & HORNET_CLOCK_CONTROL_BYPASS_MASK) { 810 /* Bypass PLL */ 811 pll_freq = ref_clock_rate; 812 cpu_div = ahb_div = ddr_div = 1; 813 } 814 else { 815 nint = (pllreg & HORNET_PLL_CONFIG_NINT_MASK) >> HORNET_PLL_CONFIG_NINT_SHIFT; 816 refdiv = (pllreg & HORNET_PLL_CONFIG_REFDIV_MASK) >> HORNET_PLL_CONFIG_REFDIV_SHIFT; 817 outdiv = (pllreg & HORNET_PLL_CONFIG_OUTDIV_MASK) >> HORNET_PLL_CONFIG_OUTDIV_SHIFT; 818 819 pll_freq = (ref_clock_rate / refdiv) * nint; 820 821 if (outdiv == 1) 822 pll_freq /= 2; 823 else if (outdiv == 2) 824 pll_freq /= 4; 825 else if (outdiv == 3) 826 pll_freq /= 8; 827 else if (outdiv == 4) 828 pll_freq /= 16; 829 else if (outdiv == 5) 830 pll_freq /= 32; 831 else if (outdiv == 6) 832 pll_freq /= 64; 833 else if (outdiv == 7) 834 pll_freq /= 128; 835 else /* outdiv == 0 --> illegal value */ 836 pll_freq /= 2; 837 838 cpu_div = (clockreg & HORNET_CLOCK_CONTROL_CPU_POST_DIV_MASK) >> HORNET_CLOCK_CONTROL_CPU_POST_DIV_SHIFT; 839 ddr_div = (clockreg & HORNET_CLOCK_CONTROL_DDR_POST_DIV_MASK) >> HORNET_CLOCK_CONTROL_DDR_POST_DIV_SFIFT; 840 ahb_div = (clockreg & HORNET_CLOCK_CONTROL_AHB_POST_DIV_MASK) >> HORNET_CLOCK_CONTROL_AHB_POST_DIV_SFIFT; 841 842 /* 843 * b00 : div by 1, b01 : div by 2, b10 : div by 3, b11 : div by 4 844 */ 845 cpu_div++; 846 ddr_div++; 847 ahb_div++; 848 } 849 850 ar7240_cpu_freq = pll_freq / cpu_div; 851 ar7240_ddr_freq = pll_freq / ddr_div; 852 ar7240_ahb_freq = pll_freq / ahb_div; 853 #endif 854 } 855 #endif 856 -
src/linux/universal/linux-3.2/arch/mips/include/asm/mach-ar71xx/ar71xx.h
r18171 r18294 86 86 #define AR71XX_MEM_SIZE_MAX 0x10000000 87 87 88 #define AR71XX_CPU_IRQ_BASE 0 89 #define AR71XX_MISC_IRQ_BASE 8 90 #define AR71XX_MISC_IRQ_COUNT 8 91 #define AR71XX_GPIO_IRQ_BASE 16 92 #define AR71XX_GPIO_IRQ_COUNT 32 93 #define AR71XX_PCI_IRQ_BASE 48 94 #define AR71XX_PCI_IRQ_COUNT 8 88 #define AR71XX_CPU_IRQ_BASE 0 89 #define AR71XX_MISC_IRQ_BASE 0x10 90 #define AR71XX_MISC_IRQ_COUNT 13 91 #define AR71XX_GPIO_IRQ_BASE 0x20 92 #define AR71XX_GPIO_IRQ_COUNT 16 93 #define AR71XX_PCI_IRQ_BASE 0x30 94 #define AR71XX_PCI_IRQ_COUNT 1 95 #define AR934X_IP2_IRQ_BASE 0x40 96 #define AR934X_IP2_IRQ_COUNT 2 95 97 96 98 #define AR71XX_CPU_IRQ_IP2 (AR71XX_CPU_IRQ_BASE + 2) -
src/linux/universal/linux-3.2/arch/mips/include/asm/mach-ar7240/ar7240.h
r18171 r18294 3 3 4 4 #include <asm/addrspace.h> 5 6 #ifdef CONFIG_MACH_HORNET 7 #include "ar933x.h" 8 #endif 5 9 6 10 typedef unsigned int ar7240_reg_t; … … 238 242 * The IPs. Connected to CPU (hardware IP's; the first two are software) 239 243 */ 240 #define AR7240_CPU_IRQ_PCI AR7240_CPU_IRQ_BASE+2 244 #ifdef CONFIG_WASP_SUPPORT 245 #define ATH_CPU_IRQ_WLAN AR7240_CPU_IRQ_BASE+2 246 #define AR7240_CPU_IRQ_PCI AR7240_CPU_IRQ_BASE+8 247 #elif defined (CONFIG_MACH_HORNET) 248 #define ATH_CPU_IRQ_WLAN AR7240_CPU_IRQ_BASE+2 249 #else 250 #define AR7240_CPU_IRQ_PCI AR7240_CPU_IRQ_BASE+2 251 #endif 241 252 #define AR7240_CPU_IRQ_USB AR7240_CPU_IRQ_BASE+3 242 253 #define AR7240_CPU_IRQ_GE0 AR7240_CPU_IRQ_BASE+4 … … 741 752 #define AR7242_REV_1_1 0x1101 742 753 #define AR9330_REV_1_0 0x0110 754 #define AR9331_REV_1_0 0x1110 743 755 #define AR9330_REV_1_1 0x0111 744 756 #define AR9331_REV_1_1 0x1111 757 #define AR9330_REV_1_2 0x0112 758 #define AR9331_REV_1_2 0x1112 745 759 #define AR9344_REV_1_0 0x2120 746 760 #define AR9342_REV_1_0 0x1120 747 761 #define AR9341_REV_1_0 0x0120 762 #define AR9344_REV_1_1 0x2121 763 #define AR9342_REV_1_1 0x1121 764 #define AR9341_REV_1_1 0x0121 748 765 749 766 … … 762 779 #define is_ar9341() ((ar7240_reg_rd(AR7240_REV_ID) & AR7240_REV_ID_MASK) == AR9341_REV_1_0) 763 780 764 #define is_ar9330() (((ar7240_reg_rd(AR7240_REV_ID) & AR7240_REV_ID_MASK) == AR9330_REV_1_0) || \ 765 ((ar7240_reg_rd(AR7240_REV_ID) & AR7240_REV_ID_MASK) == AR9330_REV_1_1)) 781 #define is_ar9330() (((ar7240_reg_rd(AR7240_REV_ID) & AR7240_REV_ID_MASK) == AR9330_REV_1_0) || \ 782 ((ar7240_reg_rd(AR7240_REV_ID) & AR7240_REV_ID_MASK) == AR9330_REV_1_1) || \ 783 ((ar7240_reg_rd(AR7240_REV_ID) & AR7240_REV_ID_MASK) == AR9330_REV_1_2)) 784 785 #define is_ar9331() (((ar7240_reg_rd(AR7240_REV_ID) & AR7240_REV_ID_MASK) == AR9331_REV_1_0) || \ 786 ((ar7240_reg_rd(AR7240_REV_ID) & AR7240_REV_ID_MASK) == AR9331_REV_1_1) || \ 787 ((ar7240_reg_rd(AR7240_REV_ID) & AR7240_REV_ID_MASK) == AR9331_REV_1_2)) 766 788 767 789 #define is_ar934x() (is_ar9344() || is_ar9342() || is_ar9341()) 790 791 #define is_ar933x() (is_ar9330() || is_ar9331()) 768 792 769 793 … … 793 817 #define AR7240_RESET_GE0_MAC (1 << 9) 794 818 #define AR7240_RESET_GE0_PHY (1 << 8) 819 #ifdef CONFIG_MACH_HORNET 820 #define AR7240_RESET_WMAC (1 << 11) 821 #else 822 #define AR7240_RESET_USB_PHY_ANALOG (1 << 11) 823 #endif 795 824 #define AR7240_RESET_PCIE_PHY_SHIFT (1 << 10) 796 825 #define AR7240_RESET_USBSUS_OVRIDE (1 << 3) -
src/linux/universal/linux-3.2/drivers/mtd/devices/Kconfig
r18171 r18294 338 338 config WZRG450NH 339 339 bool "support for buffalo WZR HP G450NH" 340 depends on MACH_AR7240 340 depends on MACH_AR7240 341 341 config WZRG300NH2 342 342 bool "support for buffalo WZR HP G300NH2" … … 344 344 config MTD_AR7240_SPI_FLASH 345 345 bool "Support for ar7240 spi flash" 346 depends on MTD && MACH_AR7240346 depends on MTD && (MACH_AR7240 || MACH_HORNET) 347 347 348 348 endmenu -
src/linux/universal/linux-3.2/drivers/mtd/maps/Makefile
r18224 r18294 62 62 obj-$(CONFIG_MACH_AR7100) += nvram_kernel.o 63 63 obj-$(CONFIG_MACH_AR7240) += nvram_kernel.o 64 obj-$(CONFIG_MACH_HORNET) += nvram_kernel.o 64 65 obj-$(CONFIG_MACH_GW2388) += nvram_kernel.o 65 66 obj-$(CONFIG_LANTIQ) += nvram_kernel.o -
src/linux/universal/linux-3.2/drivers/net/ethernet/ag7240/ag7240.c
r18171 r18294 441 441 ag7240_desc_t *r0, *t0; 442 442 uint32_t mgmt_cfg_val,ac; 443 u32 check_cnt ;443 u32 check_cnt=0; 444 444 445 445 #ifdef CONFIG_AR7242_RTL8309G_PHY … … 493 493 mgmt_cfg_val = 0x9; 494 494 break; 495 case 40: 496 case 24: 497 /* hornet emulation...ahb is either 24 or 40Mhz */ 498 mgmt_cfg_val = 0x6; 495 499 default: 496 500 mgmt_cfg_val = 0x7; … … 530 534 } 531 535 #endif 536 else 537 if(is_ar933x()){ 538 ar7240_reg_wr(AG7240_ETH_CFG, AG7240_ETH_CFG_MII_GE0_SLAVE); 539 mgmt_cfg_val = 0xF; 540 if (mac->mac_unit == 1) { 541 while (check_cnt++ < 10) { 542 ag7240_reg_wr(mac, AG7240_MAC_MII_MGMT_CFG, mgmt_cfg_val | (1 << 31)); 543 ag7240_reg_wr(mac, AG7240_MAC_MII_MGMT_CFG, mgmt_cfg_val); 544 break; 545 } 546 if(check_cnt == 11) 547 printk("%s: MDC check failed (Hornet)\n", __func__); 548 } 549 } 532 550 else { /* Python 1.0 & 1.1 */ 533 551 if (mac->mac_unit == 0) { … … 764 782 ar7100_set_gpio(13+i,0); 765 783 #endif 766 s26_wr_phy(i,0x19,(s26_rd_phy(i,0x19) | (0x3c0))); 784 if(is_ar933x()) { 785 s26_wr_phy(i,0x19, 0x3c0); 786 s26_wr_phy(i,0x18,(0x4)); 787 } else { 788 s26_wr_phy(i,0x19,(s26_rd_phy( i,0x19) | (0x3c0))); 789 } 767 790 continue; 768 791 } … … 775 798 ar7100_set_gpio(13+i,1); 776 799 #endif 800 if(is_ar933x()&& bRateTab->rate <= MB(5)){ 801 s26_wr_phy(i,0x18, 0); 802 } else { 777 803 s26_wr_phy(i,0x18,((bRateTab->timeOn << 12)|(bRateTab->timeOff << 8))); 804 } 805 if(is_ar933x()) { 806 s26_wr_phy(i,0x19, 0x140); 807 } else { 778 808 s26_wr_phy(i,0x19,(s26_rd_phy(i,0x19) & ~(0x280))); 809 } 779 810 break; 780 811 } … … 787 818 } 788 819 } 820 if(!is_ar933x()) { 789 821 /* Flush all LAN MIB counters */ 790 822 athrs26_reg_write(0x80,((1 << 17) | (1 << 24))); 791 823 while ((athrs26_reg_read(0x80) & 0x20000) == 0x20000); 792 824 athrs26_reg_write(0x80,0); 825 } 793 826 } 794 827 … … 805 838 // ar7100_set_gpio(17,0); 806 839 // #endif 840 if(is_ar933x()) { 841 s26_wr_phy(4,0x19,((0x3c0))); 842 843 }else 844 { 807 845 s26_wr_phy(4,0x19,(s26_rd_phy(4,0x19) | (0x3c0))); 846 } 808 847 goto done; 809 848 } … … 817 856 // #endif 818 857 s26_wr_phy(4,0x18,((bRateTab->timeOn << 12)|(bRateTab->timeOff << 8))); 858 if(is_ar933x()) { 859 s26_wr_phy(4,0x19,0x140); 860 } else { 819 861 s26_wr_phy(4,0x19,(s26_rd_phy(4,0x19) & ~(0x280))); 862 } 863 820 864 break; 821 865 } … … 2306 2350 #endif 2307 2351 #ifdef CONFIG_ETH_SOFT_LED 2308 if (is_ar7240())2352 if (is_ar7240() || is_ar933x()) 2309 2353 mac_set_flag(mac,ETH_SOFT_LED); 2310 2354 #endif -
src/linux/universal/linux-3.2/drivers/net/ethernet/ag7240/ag7240_phy.h
r18171 r18294 100 100 } else 101 101 #endif 102 if (is_ar7241() || is_ar7240() )102 if (is_ar7241() || is_ar7240() || is_ar933x()) 103 103 athrs26_phy_setup (unit); 104 104 else if (is_ar7242() && unit == 1) … … 127 127 #endif 128 128 129 if (is_ar7240() || is_ar7241() || (is_ar7242() && unit == 1) ) {129 if (is_ar7240() || is_ar7241() || (is_ar7242() && unit == 1) || is_ar933x()) { 130 130 *link=ag7240_phy_is_up(unit); 131 131 *fdx=ag7240_phy_is_fdx(unit, phyUnit); -
src/linux/universal/linux-3.2/drivers/tty/serial/Kconfig
r18190 r18294 1625 1625 Enable a Xilinx PS UART port to be the system console. 1626 1626 1627 config SERIAL_AR933X 1628 bool "AR933X serial port support" 1629 depends on MACH_HORNET 1630 select SERIAL_CORE 1631 help 1632 If you have an Atheros AR933X SOC based board and want to use the 1633 built-in UART of the SoC, say Y to this option. 1634 1635 config SERIAL_AR933X_CONSOLE 1636 bool "Console on AR933X serial port" 1637 depends on SERIAL_AR933X=y 1638 select SERIAL_CORE_CONSOLE 1639 help 1640 Enable a built-in UART port of the AR933X to be the system console. 1641 1642 config SERIAL_AR933X_NR_UARTS 1643 int "Maximum number of AR933X serial ports" 1644 depends on SERIAL_AR933X 1645 default "2" 1646 help 1647 Set this to the number of serial ports you want the driver 1648 to support. 1649 1650 1627 1651 endmenu -
src/linux/universal/linux-3.2/drivers/tty/serial/Makefile
r18190 r18294 98 98 obj-$(CONFIG_SERIAL_LANTIQ) += lantiq.o 99 99 obj-$(CONFIG_SERIAL_XILINX_PS_UART) += xilinx_uartps.o 100 obj-$(CONFIG_SERIAL_AR933X) += ar933x_uart.o 101 #obj-$(CONFIG_SERIAL_AR933X) += hornet_serial.o -
src/linux/universal/linux-3.2/drivers/usb/Kconfig
r18224 r18294 67 67 default y if ARCH_IXP4XX 68 68 default y if MACH_AR7100 69 default y if MACH_HORNET 69 70 default y if ARCH_W90X900 70 71 default y if ARCH_AT91SAM9G45 -
src/linux/universal/linux-3.2/drivers/usb/host/ehci-ar71xx.c
r18171 r18294 257 257 258 258 /* Added 5_29_07 */ 259 #ifdef MACH_AR7240259 #ifdef CONFIG_MACH_AR7240 260 260 ar9130_reg_rmw_set(AR9130_RESET,AR9130_RESET_USBSUS_OVRIDE |AR7240_RESET_USB_PHY_ANALOG); 261 261 #else -
src/linux/universal/linux-3.2/include/linux/serial_core.h
r18190 r18294 207 207 /* Xilinx PSS UART */ 208 208 #define PORT_XUARTPS 98 209 210 /* Atheros AR933X SoC */ 211 #define PORT_AR933X 99 209 212 210 213 #ifdef __KERNEL__ -
src/linux/universal/linux-3.2/init/main.c
r18171 r18294 574 574 * this. But we do want output early, in case something goes wrong. 575 575 */ 576 printk(KERN_EMERG "console initcall\n"); 576 577 console_init(); 578 printk(KERN_EMERG "console initcall done\n"); 577 579 if (panic_later) 578 580 panic(panic_later, panic_param); … … 785 787 }*/ 786 788 run_init_process("/sbin/init"); 789 // run_init_process("/bin/sh"); 787 790 788 791 panic("No init found. Try passing init= option to kernel. "
Note: See TracChangeset
for help on using the changeset viewer.
