blob: d24dbb1ef8ea7f77dd944dea296081cb0354b96b [file] [log] [blame]
Sergey Ryazanov43cc7392014-10-29 03:18:38 +04001#include <linux/kernel.h>
2#include <linux/init.h>
Sergey Ryazanov1ac91b12014-10-29 03:18:43 +04003#include <linux/serial_8250.h>
Sergey Ryazanov43cc7392014-10-29 03:18:38 +04004#include <asm/bootinfo.h>
5
Sergey Ryazanova7473712014-10-29 03:18:44 +04006#include <ath25_platform.h>
Sergey Ryazanov43cc7392014-10-29 03:18:38 +04007#include "devices.h"
Sergey Ryazanov1ac91b12014-10-29 03:18:43 +04008#include "ar5312.h"
9#include "ar2315.h"
Sergey Ryazanov43cc7392014-10-29 03:18:38 +040010
Sergey Ryazanova7473712014-10-29 03:18:44 +040011struct ar231x_board_config ath25_board;
12
Sergey Ryazanov43cc7392014-10-29 03:18:38 +040013const char *get_system_type(void)
14{
15 return "Atheros (unknown)";
16}
Sergey Ryazanov1ac91b12014-10-29 03:18:43 +040017
18void __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 Ryazanova7473712014-10-29 03:18:44 +040034static 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
44device_initcall(ath25_register_devices);
45
Sergey Ryazanov1ac91b12014-10-29 03:18:43 +040046static 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
56arch_initcall(ath25_arch_init);