File tree Expand file tree Collapse file tree 6 files changed +53
-0
lines changed Expand file tree Collapse file tree 6 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -267,3 +267,11 @@ void __init ar2315_plat_mem_setup(void)
267
267
268
268
_machine_restart = ar2315_restart ;
269
269
}
270
+
271
+ void __init ar2315_arch_init (void )
272
+ {
273
+ unsigned irq = irq_create_mapping (ar2315_misc_irq_domain ,
274
+ AR2315_MISC_IRQ_UART0 );
275
+
276
+ ath25_serial_setup (AR2315_UART0_BASE , irq , ar2315_apb_frequency ());
277
+ }
Original file line number Diff line number Diff line change 6
6
void ar2315_arch_init_irq (void );
7
7
void ar2315_plat_time_init (void );
8
8
void ar2315_plat_mem_setup (void );
9
+ void ar2315_arch_init (void );
9
10
10
11
#else
11
12
12
13
static inline void ar2315_arch_init_irq (void ) {}
13
14
static inline void ar2315_plat_time_init (void ) {}
14
15
static inline void ar2315_plat_mem_setup (void ) {}
16
+ static inline void ar2315_arch_init (void ) {}
15
17
16
18
#endif
17
19
Original file line number Diff line number Diff line change @@ -265,3 +265,11 @@ void __init ar5312_plat_mem_setup(void)
265
265
266
266
_machine_restart = ar5312_restart ;
267
267
}
268
+
269
+ void __init ar5312_arch_init (void )
270
+ {
271
+ unsigned irq = irq_create_mapping (ar5312_misc_irq_domain ,
272
+ AR5312_MISC_IRQ_UART0 );
273
+
274
+ ath25_serial_setup (AR5312_UART0_BASE , irq , ar5312_sys_frequency ());
275
+ }
Original file line number Diff line number Diff line change 6
6
void ar5312_arch_init_irq (void );
7
7
void ar5312_plat_time_init (void );
8
8
void ar5312_plat_mem_setup (void );
9
+ void ar5312_arch_init (void );
9
10
10
11
#else
11
12
12
13
static inline void ar5312_arch_init_irq (void ) {}
13
14
static inline void ar5312_plat_time_init (void ) {}
14
15
static inline void ar5312_plat_mem_setup (void ) {}
16
+ static inline void ar5312_arch_init (void ) {}
15
17
16
18
#endif
17
19
Original file line number Diff line number Diff line change 1
1
#include <linux/kernel.h>
2
2
#include <linux/init.h>
3
+ #include <linux/serial_8250.h>
3
4
#include <asm/bootinfo.h>
4
5
5
6
#include "devices.h"
7
+ #include "ar5312.h"
8
+ #include "ar2315.h"
6
9
7
10
const char * get_system_type (void )
8
11
{
9
12
return "Atheros (unknown)" ;
10
13
}
14
+
15
+ void __init ath25_serial_setup (u32 mapbase , int irq , unsigned int uartclk )
16
+ {
17
+ struct uart_port s ;
18
+
19
+ memset (& s , 0 , sizeof (s ));
20
+
21
+ s .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP ;
22
+ s .iotype = UPIO_MEM32 ;
23
+ s .irq = irq ;
24
+ s .regshift = 2 ;
25
+ s .mapbase = mapbase ;
26
+ s .uartclk = uartclk ;
27
+
28
+ early_serial_setup (& s );
29
+ }
30
+
31
+ static int __init ath25_arch_init (void )
32
+ {
33
+ if (is_ar5312 ())
34
+ ar5312_arch_init ();
35
+ else
36
+ ar2315_arch_init ();
37
+
38
+ return 0 ;
39
+ }
40
+
41
+ arch_initcall (ath25_arch_init );
Original file line number Diff line number Diff line change 9
9
10
10
extern void (* ath25_irq_dispatch )(void );
11
11
12
+ void ath25_serial_setup (u32 mapbase , int irq , unsigned int uartclk );
13
+
12
14
static inline bool is_ar2315 (void )
13
15
{
14
16
return (current_cpu_data .cputype == CPU_4KEC );
You can’t perform that action at this time.
0 commit comments