Sergey Ryazanov | 43cc739 | 2014-10-29 03:18:38 +0400 | [diff] [blame] | 1 | #include <linux/kernel.h> |
| 2 | #include <linux/init.h> |
Sergey Ryazanov | 1ac91b1 | 2014-10-29 03:18:43 +0400 | [diff] [blame] | 3 | #include <linux/serial_8250.h> |
Sergey Ryazanov | 43cc739 | 2014-10-29 03:18:38 +0400 | [diff] [blame] | 4 | #include <asm/bootinfo.h> |
| 5 | |
Sergey Ryazanov | a747371 | 2014-10-29 03:18:44 +0400 | [diff] [blame^] | 6 | #include <ath25_platform.h> |
Sergey Ryazanov | 43cc739 | 2014-10-29 03:18:38 +0400 | [diff] [blame] | 7 | #include "devices.h" |
Sergey Ryazanov | 1ac91b1 | 2014-10-29 03:18:43 +0400 | [diff] [blame] | 8 | #include "ar5312.h" |
| 9 | #include "ar2315.h" |
Sergey Ryazanov | 43cc739 | 2014-10-29 03:18:38 +0400 | [diff] [blame] | 10 | |
Sergey Ryazanov | a747371 | 2014-10-29 03:18:44 +0400 | [diff] [blame^] | 11 | struct ar231x_board_config ath25_board; |
| 12 | |
Sergey Ryazanov | 43cc739 | 2014-10-29 03:18:38 +0400 | [diff] [blame] | 13 | const char *get_system_type(void) |
| 14 | { |
| 15 | return "Atheros (unknown)"; |
| 16 | } |
Sergey Ryazanov | 1ac91b1 | 2014-10-29 03:18:43 +0400 | [diff] [blame] | 17 | |
| 18 | void __init ath25_serial_setup(u32 mapbase, int irq, unsigned int uartclk) |
| 19 | { |
| 20 | struct uart_port s; |
| 21 | |
| 22 | memset(&s, 0, sizeof(s)); |
| 23 | |
| 24 | s.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP; |
| 25 | s.iotype = UPIO_MEM32; |
| 26 | s.irq = irq; |
| 27 | s.regshift = 2; |
| 28 | s.mapbase = mapbase; |
| 29 | s.uartclk = uartclk; |
| 30 | |
| 31 | early_serial_setup(&s); |
| 32 | } |
| 33 | |
Sergey Ryazanov | a747371 | 2014-10-29 03:18:44 +0400 | [diff] [blame^] | 34 | static int __init ath25_register_devices(void) |
| 35 | { |
| 36 | if (is_ar5312()) |
| 37 | ar5312_init_devices(); |
| 38 | else |
| 39 | ar2315_init_devices(); |
| 40 | |
| 41 | return 0; |
| 42 | } |
| 43 | |
| 44 | device_initcall(ath25_register_devices); |
| 45 | |
Sergey Ryazanov | 1ac91b1 | 2014-10-29 03:18:43 +0400 | [diff] [blame] | 46 | static int __init ath25_arch_init(void) |
| 47 | { |
| 48 | if (is_ar5312()) |
| 49 | ar5312_arch_init(); |
| 50 | else |
| 51 | ar2315_arch_init(); |
| 52 | |
| 53 | return 0; |
| 54 | } |
| 55 | |
| 56 | arch_initcall(ath25_arch_init); |