blob: 5c6a9b24740a049116d5b354e92cb55fa1c24e13 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mach-mmp/common.c
4 *
5 * Code common to PXA168 processor lines
6 */
7
8#include <linux/init.h>
9#include <linux/kernel.h>
10#include <linux/module.h>
11
12#include <asm/page.h>
13#include <asm/mach/map.h>
14#include <asm/system_misc.h>
15#include <soc/asr/addr-map.h>
16#include "cputype.h"
17
18#include "common.h"
19
20#define MMP_CHIPID (AXI_VIRT_BASE + 0x82c00)
21
22unsigned int mmp_chip_id;
23EXPORT_SYMBOL(mmp_chip_id);
24
25static struct map_desc standard_io_desc[] __initdata = {
26 {
27 .pfn = __phys_to_pfn(APB_PHYS_BASE),
28 .virtual = (unsigned long)APB_VIRT_BASE,
29 .length = APB_PHYS_SIZE,
30 .type = MT_DEVICE,
31 }, {
32 .pfn = __phys_to_pfn(AXI_PHYS_BASE),
33 .virtual = (unsigned long)AXI_VIRT_BASE,
34 .length = AXI_PHYS_SIZE,
35 .type = MT_DEVICE,
36 }, {
37 .pfn = __phys_to_pfn(MMP_CORE_PERIPH_PHYS_BASE),
38 .virtual = (unsigned long)MMP_CORE_PERIPH_VIRT_BASE,
39 .length = MMP_CORE_PERIPH_PHYS_SIZE,
40 .type = MT_DEVICE,
41#ifdef DMCU_PHYS_BASE
42 }, {
43 .pfn = __phys_to_pfn(DMCU_PHYS_BASE),
44 .virtual = (unsigned long)DMCU_VIRT_BASE,
45 .length = DMCU_PHYS_SIZE,
46 .type = MT_DEVICE,
47#endif
48 }
49};
50
51void __init mmp_map_io(void)
52{
53 iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
54
55 /* this is early, initialize mmp_chip_id here */
56 mmp_chip_id = __raw_readl(MMP_CHIPID);
57}
58
59void mmp_restart(enum reboot_mode mode, const char *cmd)
60{
61 soft_restart(0);
62}