18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  This file contains the hardware definitions of the Integrator.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *  Copyright (C) 1998-1999 ARM Limited.
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci#ifndef INTEGRATOR_HARDWARE_H
88c2ecf20Sopenharmony_ci#define INTEGRATOR_HARDWARE_H
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci/*
118c2ecf20Sopenharmony_ci * Where in virtual memory the IO devices (timers, system controllers
128c2ecf20Sopenharmony_ci * and so on)
138c2ecf20Sopenharmony_ci */
148c2ecf20Sopenharmony_ci#define IO_BASE			0xF0000000                 // VA of IO
158c2ecf20Sopenharmony_ci#define IO_SIZE			0x0B000000                 // How much?
168c2ecf20Sopenharmony_ci#define IO_START		INTEGRATOR_HDR_BASE        // PA of IO
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci/* macro to get at IO space when running virtually */
198c2ecf20Sopenharmony_ci#ifdef CONFIG_MMU
208c2ecf20Sopenharmony_ci#define IO_ADDRESS(x)	(((x) & 0x000fffff) | (((x) >> 4) & 0x0ff00000) | IO_BASE)
218c2ecf20Sopenharmony_ci#else
228c2ecf20Sopenharmony_ci#define IO_ADDRESS(x)	(x)
238c2ecf20Sopenharmony_ci#endif
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#define __io_address(n)		((void __iomem *)IO_ADDRESS(n))
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci/*
288c2ecf20Sopenharmony_ci *  Integrator memory map
298c2ecf20Sopenharmony_ci */
308c2ecf20Sopenharmony_ci#define INTEGRATOR_BOOT_ROM_LO          0x00000000
318c2ecf20Sopenharmony_ci#define INTEGRATOR_BOOT_ROM_HI          0x20000000
328c2ecf20Sopenharmony_ci#define INTEGRATOR_BOOT_ROM_BASE        INTEGRATOR_BOOT_ROM_HI	 /*  Normal position */
338c2ecf20Sopenharmony_ci#define INTEGRATOR_BOOT_ROM_SIZE        SZ_512K
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci/*
368c2ecf20Sopenharmony_ci * New Core Modules have different amounts of SSRAM, the amount of SSRAM
378c2ecf20Sopenharmony_ci * fitted can be found in HDR_STAT.
388c2ecf20Sopenharmony_ci *
398c2ecf20Sopenharmony_ci * The symbol INTEGRATOR_SSRAM_SIZE is kept, however this now refers to
408c2ecf20Sopenharmony_ci * the minimum amount of SSRAM fitted on any core module.
418c2ecf20Sopenharmony_ci *
428c2ecf20Sopenharmony_ci * New Core Modules also alias the SSRAM.
438c2ecf20Sopenharmony_ci *
448c2ecf20Sopenharmony_ci */
458c2ecf20Sopenharmony_ci#define INTEGRATOR_SSRAM_BASE           0x00000000
468c2ecf20Sopenharmony_ci#define INTEGRATOR_SSRAM_ALIAS_BASE     0x10800000
478c2ecf20Sopenharmony_ci#define INTEGRATOR_SSRAM_SIZE           SZ_256K
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci#define INTEGRATOR_FLASH_BASE           0x24000000
508c2ecf20Sopenharmony_ci#define INTEGRATOR_FLASH_SIZE           SZ_32M
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#define INTEGRATOR_MBRD_SSRAM_BASE      0x28000000
538c2ecf20Sopenharmony_ci#define INTEGRATOR_MBRD_SSRAM_SIZE      SZ_512K
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci/*
568c2ecf20Sopenharmony_ci *  SDRAM is a SIMM therefore the size is not known.
578c2ecf20Sopenharmony_ci */
588c2ecf20Sopenharmony_ci#define INTEGRATOR_SDRAM_BASE           0x00040000
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci#define INTEGRATOR_SDRAM_ALIAS_BASE     0x80000000
618c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR0_SDRAM_BASE      0x80000000
628c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR1_SDRAM_BASE      0x90000000
638c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR2_SDRAM_BASE      0xA0000000
648c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR3_SDRAM_BASE      0xB0000000
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci/*
678c2ecf20Sopenharmony_ci *  Logic expansion modules
688c2ecf20Sopenharmony_ci *
698c2ecf20Sopenharmony_ci */
708c2ecf20Sopenharmony_ci#define INTEGRATOR_LOGIC_MODULES_BASE   0xC0000000
718c2ecf20Sopenharmony_ci#define INTEGRATOR_LOGIC_MODULE0_BASE   0xC0000000
728c2ecf20Sopenharmony_ci#define INTEGRATOR_LOGIC_MODULE1_BASE   0xD0000000
738c2ecf20Sopenharmony_ci#define INTEGRATOR_LOGIC_MODULE2_BASE   0xE0000000
748c2ecf20Sopenharmony_ci#define INTEGRATOR_LOGIC_MODULE3_BASE   0xF0000000
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci/*
778c2ecf20Sopenharmony_ci * Integrator header card registers
788c2ecf20Sopenharmony_ci */
798c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_ID_OFFSET        0x00
808c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_PROC_OFFSET      0x04
818c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_OFFSET       0x08
828c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_CTRL_OFFSET      0x0C
838c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_STAT_OFFSET      0x10
848c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_LOCK_OFFSET      0x14
858c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_SDRAM_OFFSET     0x20
868c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_INIT_OFFSET      0x24	 /*  CM9x6 */
878c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_IC_OFFSET        0x40
888c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_SPDBASE_OFFSET   0x100
898c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_SPDTOP_OFFSET    0x200
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_BASE             0x10000000
928c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_ID               (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_ID_OFFSET)
938c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_PROC             (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_PROC_OFFSET)
948c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC              (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_OSC_OFFSET)
958c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_CTRL             (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_CTRL_OFFSET)
968c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_STAT             (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_STAT_OFFSET)
978c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_LOCK             (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_LOCK_OFFSET)
988c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_SDRAM            (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_SDRAM_OFFSET)
998c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_INIT             (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_INIT_OFFSET)
1008c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_IC               (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_IC_OFFSET)
1018c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_SPDBASE          (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_SPDBASE_OFFSET)
1028c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_SPDTOP           (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_SPDTOP_OFFSET)
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_CTRL_LED         0x01
1058c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_CTRL_MBRD_DETECH 0x02
1068c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_CTRL_REMAP       0x04
1078c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_CTRL_RESET       0x08
1088c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_CTRL_HIGHVECTORS 0x10
1098c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_CTRL_BIG_ENDIAN  0x20
1108c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_CTRL_FASTBUS     0x40
1118c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_CTRL_SYNC        0x80
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_10MHz   0x102
1148c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_15MHz   0x107
1158c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_20MHz   0x10C
1168c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_25MHz   0x111
1178c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_30MHz   0x116
1188c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_35MHz   0x11B
1198c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_40MHz   0x120
1208c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_45MHz   0x125
1218c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_50MHz   0x12A
1228c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_55MHz   0x12F
1238c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_60MHz   0x134
1248c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_65MHz   0x139
1258c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_70MHz   0x13E
1268c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_75MHz   0x143
1278c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_80MHz   0x148
1288c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_85MHz   0x14D
1298c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_90MHz   0x152
1308c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_95MHz   0x157
1318c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_100MHz  0x15C
1328c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_105MHz  0x161
1338c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_110MHz  0x166
1348c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_115MHz  0x16B
1358c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_120MHz  0x170
1368c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_125MHz  0x175
1378c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_130MHz  0x17A
1388c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_135MHz  0x17F
1398c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_140MHz  0x184
1408c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_145MHz  0x189
1418c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_150MHz  0x18E
1428c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_155MHz  0x193
1438c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_160MHz  0x198
1448c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_CORE_MASK    0x7FF
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_MEM_10MHz    0x10C000
1478c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_MEM_15MHz    0x116000
1488c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_MEM_20MHz    0x120000
1498c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_MEM_25MHz    0x12A000
1508c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_MEM_30MHz    0x134000
1518c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_MEM_33MHz    0x13A000
1528c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_MEM_40MHz    0x148000
1538c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_MEM_50MHz    0x15C000
1548c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_MEM_60MHz    0x170000
1558c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_MEM_66MHz    0x17C000
1568c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_MEM_MASK     0x7FF000
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_BUS_MODE_CM7x0  0x0
1598c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_BUS_MODE_CM9x0  0x0800000
1608c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_BUS_MODE_CM9x6  0x1000000
1618c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_BUS_MODE_CM10x00  0x1800000
1628c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_OSC_BUS_MODE_MASK  0x1800000
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci#define INTEGRATOR_HDR_SDRAM_SPD_OK     (1 << 5)
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci/*
1678c2ecf20Sopenharmony_ci * Integrator system registers
1688c2ecf20Sopenharmony_ci */
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_ci/*
1718c2ecf20Sopenharmony_ci *  System Controller
1728c2ecf20Sopenharmony_ci */
1738c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_ID_OFFSET         0x00
1748c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_OSC_OFFSET        0x04
1758c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_CTRLS_OFFSET      0x08
1768c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_CTRLC_OFFSET      0x0C
1778c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_DEC_OFFSET        0x10
1788c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_ARB_OFFSET        0x14
1798c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_LOCK_OFFSET       0x1C
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_BASE              0x11000000
1828c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_ID                (INTEGRATOR_SC_BASE + INTEGRATOR_SC_ID_OFFSET)
1838c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_OSC               (INTEGRATOR_SC_BASE + INTEGRATOR_SC_OSC_OFFSET)
1848c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_CTRLS             (INTEGRATOR_SC_BASE + INTEGRATOR_SC_CTRLS_OFFSET)
1858c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_CTRLC             (INTEGRATOR_SC_BASE + INTEGRATOR_SC_CTRLC_OFFSET)
1868c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_DEC               (INTEGRATOR_SC_BASE + INTEGRATOR_SC_DEC_OFFSET)
1878c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_ARB               (INTEGRATOR_SC_BASE + INTEGRATOR_SC_ARB_OFFSET)
1888c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_PCIENABLE         (INTEGRATOR_SC_BASE + INTEGRATOR_SC_PCIENABLE_OFFSET)
1898c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_LOCK              (INTEGRATOR_SC_BASE + INTEGRATOR_SC_LOCK_OFFSET)
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_OSC_SYS_10MHz     0x20
1928c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_OSC_SYS_15MHz     0x34
1938c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_OSC_SYS_20MHz     0x48
1948c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_OSC_SYS_25MHz     0x5C
1958c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_OSC_SYS_33MHz     0x7C
1968c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_OSC_SYS_MASK      0xFF
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_OSC_PCI_25MHz     0x100
1998c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_OSC_PCI_33MHz     0x0
2008c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_OSC_PCI_MASK      0x100
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_CTRL_SOFTRST      (1 << 0)
2038c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_CTRL_nFLVPPEN     (1 << 1)
2048c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_CTRL_nFLWP        (1 << 2)
2058c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_CTRL_URTS0        (1 << 4)
2068c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_CTRL_UDTR0        (1 << 5)
2078c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_CTRL_URTS1        (1 << 6)
2088c2ecf20Sopenharmony_ci#define INTEGRATOR_SC_CTRL_UDTR1        (1 << 7)
2098c2ecf20Sopenharmony_ci
2108c2ecf20Sopenharmony_ci/*
2118c2ecf20Sopenharmony_ci *  External Bus Interface
2128c2ecf20Sopenharmony_ci */
2138c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_BASE             0x12000000
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_CSR0_OFFSET      0x00
2168c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_CSR1_OFFSET      0x04
2178c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_CSR2_OFFSET      0x08
2188c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_CSR3_OFFSET      0x0C
2198c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_LOCK_OFFSET      0x20
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_CSR0             (INTEGRATOR_EBI_BASE + INTEGRATOR_EBI_CSR0_OFFSET)
2228c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_CSR1             (INTEGRATOR_EBI_BASE + INTEGRATOR_EBI_CSR1_OFFSET)
2238c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_CSR2             (INTEGRATOR_EBI_BASE + INTEGRATOR_EBI_CSR2_OFFSET)
2248c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_CSR3             (INTEGRATOR_EBI_BASE + INTEGRATOR_EBI_CSR3_OFFSET)
2258c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_LOCK             (INTEGRATOR_EBI_BASE + INTEGRATOR_EBI_LOCK_OFFSET)
2268c2ecf20Sopenharmony_ci
2278c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_8_BIT            0x00
2288c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_16_BIT           0x01
2298c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_32_BIT           0x02
2308c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WRITE_ENABLE     0x04
2318c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_SYNC             0x08
2328c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WS_2             0x00
2338c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WS_3             0x10
2348c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WS_4             0x20
2358c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WS_5             0x30
2368c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WS_6             0x40
2378c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WS_7             0x50
2388c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WS_8             0x60
2398c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WS_9             0x70
2408c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WS_10            0x80
2418c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WS_11            0x90
2428c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WS_12            0xA0
2438c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WS_13            0xB0
2448c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WS_14            0xC0
2458c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WS_15            0xD0
2468c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WS_16            0xE0
2478c2ecf20Sopenharmony_ci#define INTEGRATOR_EBI_WS_17            0xF0
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_ci
2508c2ecf20Sopenharmony_ci#define INTEGRATOR_CT_BASE              0x13000000	 /*  Counter/Timers */
2518c2ecf20Sopenharmony_ci#define INTEGRATOR_IC_BASE              0x14000000	 /*  Interrupt Controller */
2528c2ecf20Sopenharmony_ci#define INTEGRATOR_RTC_BASE             0x15000000	 /*  Real Time Clock */
2538c2ecf20Sopenharmony_ci#define INTEGRATOR_UART0_BASE           0x16000000	 /*  UART 0 */
2548c2ecf20Sopenharmony_ci#define INTEGRATOR_UART1_BASE           0x17000000	 /*  UART 1 */
2558c2ecf20Sopenharmony_ci#define INTEGRATOR_KBD_BASE             0x18000000	 /*  Keyboard */
2568c2ecf20Sopenharmony_ci#define INTEGRATOR_MOUSE_BASE           0x19000000	 /*  Mouse */
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ci/*
2598c2ecf20Sopenharmony_ci *  LED's & Switches
2608c2ecf20Sopenharmony_ci */
2618c2ecf20Sopenharmony_ci#define INTEGRATOR_DBG_ALPHA_OFFSET     0x00
2628c2ecf20Sopenharmony_ci#define INTEGRATOR_DBG_LEDS_OFFSET      0x04
2638c2ecf20Sopenharmony_ci#define INTEGRATOR_DBG_SWITCH_OFFSET    0x08
2648c2ecf20Sopenharmony_ci
2658c2ecf20Sopenharmony_ci#define INTEGRATOR_DBG_BASE             0x1A000000
2668c2ecf20Sopenharmony_ci#define INTEGRATOR_DBG_ALPHA            (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_ALPHA_OFFSET)
2678c2ecf20Sopenharmony_ci#define INTEGRATOR_DBG_LEDS             (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_LEDS_OFFSET)
2688c2ecf20Sopenharmony_ci#define INTEGRATOR_DBG_SWITCH           (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_SWITCH_OFFSET)
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_ci#define INTEGRATOR_AP_GPIO_BASE		0x1B000000	/* GPIO */
2718c2ecf20Sopenharmony_ci
2728c2ecf20Sopenharmony_ci#define INTEGRATOR_CP_MMC_BASE		0x1C000000	/* MMC */
2738c2ecf20Sopenharmony_ci#define INTEGRATOR_CP_AACI_BASE		0x1D000000	/* AACI */
2748c2ecf20Sopenharmony_ci#define INTEGRATOR_CP_ETH_BASE		0xC8000000	/* Ethernet */
2758c2ecf20Sopenharmony_ci#define INTEGRATOR_CP_GPIO_BASE		0xC9000000	/* GPIO */
2768c2ecf20Sopenharmony_ci#define INTEGRATOR_CP_SIC_BASE		0xCA000000	/* SIC */
2778c2ecf20Sopenharmony_ci#define INTEGRATOR_CP_CTL_BASE		0xCB000000	/* CP system control */
2788c2ecf20Sopenharmony_ci
2798c2ecf20Sopenharmony_ci/* PS2 Keyboard interface */
2808c2ecf20Sopenharmony_ci#define KMI0_BASE                       INTEGRATOR_KBD_BASE
2818c2ecf20Sopenharmony_ci
2828c2ecf20Sopenharmony_ci/* PS2 Mouse interface */
2838c2ecf20Sopenharmony_ci#define KMI1_BASE                       INTEGRATOR_MOUSE_BASE
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_ci/*
2868c2ecf20Sopenharmony_ci * Integrator Interrupt Controllers
2878c2ecf20Sopenharmony_ci *
2888c2ecf20Sopenharmony_ci *
2898c2ecf20Sopenharmony_ci * Offsets from interrupt controller base
2908c2ecf20Sopenharmony_ci *
2918c2ecf20Sopenharmony_ci * System Controller interrupt controller base is
2928c2ecf20Sopenharmony_ci *
2938c2ecf20Sopenharmony_ci * 	INTEGRATOR_IC_BASE + (header_number << 6)
2948c2ecf20Sopenharmony_ci *
2958c2ecf20Sopenharmony_ci * Core Module interrupt controller base is
2968c2ecf20Sopenharmony_ci *
2978c2ecf20Sopenharmony_ci * 	INTEGRATOR_HDR_IC
2988c2ecf20Sopenharmony_ci */
2998c2ecf20Sopenharmony_ci#define IRQ_STATUS                      0
3008c2ecf20Sopenharmony_ci#define IRQ_RAW_STATUS                  0x04
3018c2ecf20Sopenharmony_ci#define IRQ_ENABLE                      0x08
3028c2ecf20Sopenharmony_ci#define IRQ_ENABLE_SET                  0x08
3038c2ecf20Sopenharmony_ci#define IRQ_ENABLE_CLEAR                0x0C
3048c2ecf20Sopenharmony_ci
3058c2ecf20Sopenharmony_ci#define INT_SOFT_SET                    0x10
3068c2ecf20Sopenharmony_ci#define INT_SOFT_CLEAR                  0x14
3078c2ecf20Sopenharmony_ci
3088c2ecf20Sopenharmony_ci#define FIQ_STATUS                      0x20
3098c2ecf20Sopenharmony_ci#define FIQ_RAW_STATUS                  0x24
3108c2ecf20Sopenharmony_ci#define FIQ_ENABLE                      0x28
3118c2ecf20Sopenharmony_ci#define FIQ_ENABLE_SET                  0x28
3128c2ecf20Sopenharmony_ci#define FIQ_ENABLE_CLEAR                0x2C
3138c2ecf20Sopenharmony_ci
3148c2ecf20Sopenharmony_ci
3158c2ecf20Sopenharmony_ci/*
3168c2ecf20Sopenharmony_ci * LED's
3178c2ecf20Sopenharmony_ci */
3188c2ecf20Sopenharmony_ci#define GREEN_LED                       0x01
3198c2ecf20Sopenharmony_ci#define YELLOW_LED                      0x02
3208c2ecf20Sopenharmony_ci#define RED_LED                         0x04
3218c2ecf20Sopenharmony_ci#define GREEN_LED_2                     0x08
3228c2ecf20Sopenharmony_ci#define ALL_LEDS                        0x0F
3238c2ecf20Sopenharmony_ci
3248c2ecf20Sopenharmony_ci#define LED_BANK                        INTEGRATOR_DBG_LEDS
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_ci/*
3278c2ecf20Sopenharmony_ci *  Timer definitions
3288c2ecf20Sopenharmony_ci *
3298c2ecf20Sopenharmony_ci *  Only use timer 1 & 2
3308c2ecf20Sopenharmony_ci *  (both run at 24MHz and will need the clock divider set to 16).
3318c2ecf20Sopenharmony_ci *
3328c2ecf20Sopenharmony_ci *  Timer 0 runs at bus frequency
3338c2ecf20Sopenharmony_ci */
3348c2ecf20Sopenharmony_ci#define INTEGRATOR_TIMER0_BASE          INTEGRATOR_CT_BASE
3358c2ecf20Sopenharmony_ci#define INTEGRATOR_TIMER1_BASE          (INTEGRATOR_CT_BASE + 0x100)
3368c2ecf20Sopenharmony_ci#define INTEGRATOR_TIMER2_BASE          (INTEGRATOR_CT_BASE + 0x200)
3378c2ecf20Sopenharmony_ci
3388c2ecf20Sopenharmony_ci#define INTEGRATOR_CSR_BASE             0x10000000
3398c2ecf20Sopenharmony_ci#define INTEGRATOR_CSR_SIZE             0x10000000
3408c2ecf20Sopenharmony_ci
3418c2ecf20Sopenharmony_ci#endif /* INTEGRATOR_HARDWARE_H */
342