treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / mips / vr41xx / common / init.c
blobca53ac3060efbf152b9c932214330ab6298b3a8c
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * init.c, Common initialization routines for NEC VR4100 series.
5 * Copyright (C) 2003-2009 Yoichi Yuasa <yuasa@linux-mips.org>
6 */
7 #include <linux/init.h>
8 #include <linux/ioport.h>
9 #include <linux/irq.h>
10 #include <linux/string.h>
12 #include <asm/bootinfo.h>
13 #include <asm/time.h>
14 #include <asm/vr41xx/irq.h>
15 #include <asm/vr41xx/vr41xx.h>
17 #define IO_MEM_RESOURCE_START 0UL
18 #define IO_MEM_RESOURCE_END 0x1fffffffUL
20 static void __init iomem_resource_init(void)
22 iomem_resource.start = IO_MEM_RESOURCE_START;
23 iomem_resource.end = IO_MEM_RESOURCE_END;
26 void __init plat_time_init(void)
28 unsigned long tclock;
30 vr41xx_calculate_clock_frequency();
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;
40 void __init plat_mem_setup(void)
42 iomem_resource_init();
44 vr41xx_siu_setup();
47 void __init prom_init(void)
49 int argc, i;
50 char **argv;
52 argc = fw_arg0;
53 argv = (char **)fw_arg1;
55 for (i = 1; i < argc; i++) {
56 strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE);
57 if (i < (argc - 1))
58 strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
62 void __init prom_free_prom_memory(void)