xref: /linux/arch/mips/include/asm/mips-boards/malta.h (revision cbecf716ca618fd44feda6bd9a64a8179d031fc5)
141173abcSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
2384740dcSRalf Baechle /*
3384740dcSRalf Baechle  * Carsten Langgaard, carstenl@mips.com
4384740dcSRalf Baechle  * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
5384740dcSRalf Baechle  *
6384740dcSRalf Baechle  * Defines of the Malta board specific address-MAP, registers, etc.
7384740dcSRalf Baechle  */
8384740dcSRalf Baechle #ifndef __ASM_MIPS_BOARDS_MALTA_H
9384740dcSRalf Baechle #define __ASM_MIPS_BOARDS_MALTA_H
10384740dcSRalf Baechle 
11384740dcSRalf Baechle #include <asm/addrspace.h>
12384740dcSRalf Baechle #include <asm/io.h>
13384740dcSRalf Baechle #include <asm/mips-boards/msc01_pci.h>
14384740dcSRalf Baechle #include <asm/gt64120.h>
15384740dcSRalf Baechle 
16384740dcSRalf Baechle /* Mips interrupt controller found in SOCit variations */
17384740dcSRalf Baechle #define MIPS_MSC01_IC_REG_BASE		0x1bc40000
18384740dcSRalf Baechle #define MIPS_SOCITSC_IC_REG_BASE	0x1ffa0000
19384740dcSRalf Baechle 
20384740dcSRalf Baechle /*
21384740dcSRalf Baechle  * Malta I/O ports base address for the Galileo GT64120 and Algorithmics
22384740dcSRalf Baechle  * Bonito system controllers.
23384740dcSRalf Baechle  */
24384740dcSRalf Baechle #define MALTA_GT_PORT_BASE	get_gt_port_base(GT_PCI0IOLD_OFS)
25384740dcSRalf Baechle #define MALTA_BONITO_PORT_BASE	((unsigned long)ioremap (0x1fd00000, 0x10000))
26384740dcSRalf Baechle #define MALTA_MSC_PORT_BASE	get_msc_port_base(MSC01_PCI_SC2PIOBASL)
27384740dcSRalf Baechle 
get_gt_port_base(unsigned long reg)28384740dcSRalf Baechle static inline unsigned long get_gt_port_base(unsigned long reg)
29384740dcSRalf Baechle {
30384740dcSRalf Baechle 	unsigned long addr;
31384740dcSRalf Baechle 	addr = GT_READ(reg);
32384740dcSRalf Baechle 	return (unsigned long) ioremap (((addr & 0xffff) << 21), 0x10000);
33384740dcSRalf Baechle }
34384740dcSRalf Baechle 
get_msc_port_base(unsigned long reg)35384740dcSRalf Baechle static inline unsigned long get_msc_port_base(unsigned long reg)
36384740dcSRalf Baechle {
37384740dcSRalf Baechle 	unsigned long addr;
38384740dcSRalf Baechle 	MSC_READ(reg, addr);
39384740dcSRalf Baechle 	return (unsigned long) ioremap(addr, 0x10000);
40384740dcSRalf Baechle }
41384740dcSRalf Baechle 
42384740dcSRalf Baechle /*
43384740dcSRalf Baechle  * GCMP Specific definitions
44384740dcSRalf Baechle  */
45384740dcSRalf Baechle #define GCMP_BASE_ADDR			0x1fbf8000
46384740dcSRalf Baechle #define GCMP_ADDRSPACE_SZ		(256 * 1024)
47384740dcSRalf Baechle 
48384740dcSRalf Baechle /*
49384740dcSRalf Baechle  * GIC Specific definitions
50384740dcSRalf Baechle  */
51384740dcSRalf Baechle #define GIC_BASE_ADDR			0x1bdc0000
52384740dcSRalf Baechle #define GIC_ADDRSPACE_SZ		(128 * 1024)
53384740dcSRalf Baechle 
54384740dcSRalf Baechle /*
557dc2834fSPaul Burton  * CPC Specific definitions
567dc2834fSPaul Burton  */
577dc2834fSPaul Burton #define CPC_BASE_ADDR			0x1bde0000
587dc2834fSPaul Burton 
597dc2834fSPaul Burton /*
60384740dcSRalf Baechle  * MSC01 BIU Specific definitions
61384740dcSRalf Baechle  * FIXME : These should be elsewhere ?
62384740dcSRalf Baechle  */
63384740dcSRalf Baechle #define MSC01_BIU_REG_BASE		0x1bc80000
64384740dcSRalf Baechle #define MSC01_BIU_ADDRSPACE_SZ		(256 * 1024)
65384740dcSRalf Baechle #define MSC01_SC_CFG_OFS		0x0110
66384740dcSRalf Baechle #define MSC01_SC_CFG_GICPRES_MSK	0x00000004
67384740dcSRalf Baechle #define MSC01_SC_CFG_GICPRES_SHF	2
68384740dcSRalf Baechle #define MSC01_SC_CFG_GICENA_SHF		3
69384740dcSRalf Baechle 
70384740dcSRalf Baechle /*
71384740dcSRalf Baechle  * Malta RTC-device indirect register access.
72384740dcSRalf Baechle  */
73384740dcSRalf Baechle #define MALTA_RTC_ADR_REG	0x70
74384740dcSRalf Baechle #define MALTA_RTC_DAT_REG	0x71
75384740dcSRalf Baechle 
76384740dcSRalf Baechle /*
77384740dcSRalf Baechle  * Malta SMSC FDC37M817 Super I/O Controller register.
78384740dcSRalf Baechle  */
79384740dcSRalf Baechle #define SMSC_CONFIG_REG		0x3f0
80384740dcSRalf Baechle #define SMSC_DATA_REG		0x3f1
81384740dcSRalf Baechle 
82384740dcSRalf Baechle #define SMSC_CONFIG_DEVNUM	0x7
83384740dcSRalf Baechle #define SMSC_CONFIG_ACTIVATE	0x30
84384740dcSRalf Baechle #define SMSC_CONFIG_ENTER	0x55
85384740dcSRalf Baechle #define SMSC_CONFIG_EXIT	0xaa
86384740dcSRalf Baechle 
87384740dcSRalf Baechle #define SMSC_CONFIG_DEVNUM_FLOPPY     0
88384740dcSRalf Baechle 
89384740dcSRalf Baechle #define SMSC_CONFIG_ACTIVATE_ENABLE   1
90384740dcSRalf Baechle 
91384740dcSRalf Baechle #define SMSC_WRITE(x, a)     outb(x, a)
92384740dcSRalf Baechle 
93384740dcSRalf Baechle #define MALTA_JMPRS_REG		0x1f000210
94384740dcSRalf Baechle 
95*307c9926SThomas Bogendoerfer extern void __init *malta_dt_shim(void *fdt);
96*307c9926SThomas Bogendoerfer 
97384740dcSRalf Baechle #endif /* __ASM_MIPS_BOARDS_MALTA_H */
98