Commit | Line | Data |
---|---|---|
1a59d1b8 | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
1da177e4 LT |
2 | /* |
3 | * init.c, Common initialization routines for NEC VR4100 series. | |
4 | * | |
66a0f0f2 | 5 | * Copyright (C) 2003-2009 Yoichi Yuasa <yuasa@linux-mips.org> |
1da177e4 LT |
6 | */ |
7 | #include <linux/init.h> | |
8 | #include <linux/ioport.h> | |
9 | #include <linux/irq.h> | |
10 | #include <linux/string.h> | |
11 | ||
12 | #include <asm/bootinfo.h> | |
13 | #include <asm/time.h> | |
66151bbd | 14 | #include <asm/vr41xx/irq.h> |
1da177e4 LT |
15 | #include <asm/vr41xx/vr41xx.h> |
16 | ||
17 | #define IO_MEM_RESOURCE_START 0UL | |
18 | #define IO_MEM_RESOURCE_END 0x1fffffffUL | |
19 | ||
20 | static void __init iomem_resource_init(void) | |
21 | { | |
22 | iomem_resource.start = IO_MEM_RESOURCE_START; | |
23 | iomem_resource.end = IO_MEM_RESOURCE_END; | |
24 | } | |
25 | ||
4b550488 | 26 | void __init plat_time_init(void) |
1da177e4 LT |
27 | { |
28 | unsigned long tclock; | |
29 | ||
991f8b6a YY |
30 | vr41xx_calculate_clock_frequency(); |
31 | ||
1da177e4 LT |
32 | tclock = vr41xx_get_tclock_frequency(); |
33 | if (current_cpu_data.processor_id == PRID_VR4131_REV2_0 || | |
34 | current_cpu_data.processor_id == PRID_VR4131_REV2_1) | |
35 | mips_hpt_frequency = tclock / 2; | |
36 | else | |
37 | mips_hpt_frequency = tclock / 4; | |
38 | } | |
39 | ||
2925aba4 | 40 | void __init plat_mem_setup(void) |
c83cfc9c | 41 | { |
c83cfc9c | 42 | iomem_resource_init(); |
fc3f341b YY |
43 | |
44 | vr41xx_siu_setup(); | |
c83cfc9c RB |
45 | } |
46 | ||
1da177e4 LT |
47 | void __init prom_init(void) |
48 | { | |
49 | int argc, i; | |
50 | char **argv; | |
51 | ||
52 | argc = fw_arg0; | |
53 | argv = (char **)fw_arg1; | |
54 | ||
55 | for (i = 1; i < argc; i++) { | |
66a0f0f2 | 56 | strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE); |
1da177e4 | 57 | if (i < (argc - 1)) |
66a0f0f2 | 58 | strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE); |
1da177e4 | 59 | } |
1da177e4 LT |
60 | } |
61 | ||
c44e8d5e | 62 | void __init prom_free_prom_memory(void) |
1da177e4 | 63 | { |
1da177e4 | 64 | } |