18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  arch/arm/mach-footbridge/include/mach/hardware.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *  Copyright (C) 1998-1999 Russell King.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci *  This file contains the hardware definitions of the EBSA-285.
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci#ifndef __ASM_ARCH_HARDWARE_H
108c2ecf20Sopenharmony_ci#define __ASM_ARCH_HARDWARE_H
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci/*   Virtual      Physical	Size
138c2ecf20Sopenharmony_ci * 0xff800000	0x40000000	1MB	X-Bus
148c2ecf20Sopenharmony_ci * 0xff000000	0x7c000000	1MB	PCI I/O space
158c2ecf20Sopenharmony_ci * 0xfe000000	0x42000000	1MB	CSR
168c2ecf20Sopenharmony_ci * 0xfd000000	0x78000000	1MB	Outbound write flush (not supported)
178c2ecf20Sopenharmony_ci * 0xfc000000	0x79000000	1MB	PCI IACK/special space
188c2ecf20Sopenharmony_ci * 0xfb000000	0x7a000000	16MB	PCI Config type 1
198c2ecf20Sopenharmony_ci * 0xfa000000	0x7b000000	16MB	PCI Config type 0
208c2ecf20Sopenharmony_ci * 0xf9000000	0x50000000	1MB	Cache flush
218c2ecf20Sopenharmony_ci * 0xf0000000	0x80000000	16MB	ISA memory
228c2ecf20Sopenharmony_ci */
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#ifdef CONFIG_MMU
258c2ecf20Sopenharmony_ci#define MMU_IO(a, b)	(a)
268c2ecf20Sopenharmony_ci#else
278c2ecf20Sopenharmony_ci#define MMU_IO(a, b)	(b)
288c2ecf20Sopenharmony_ci#endif
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#define XBUS_SIZE		0x00100000
318c2ecf20Sopenharmony_ci#define XBUS_BASE		MMU_IO(0xff800000, 0x40000000)
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#define ARMCSR_SIZE		0x00100000
348c2ecf20Sopenharmony_ci#define ARMCSR_BASE		MMU_IO(0xfe000000, 0x42000000)
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci#define WFLUSH_SIZE		0x00100000
378c2ecf20Sopenharmony_ci#define WFLUSH_BASE		MMU_IO(0xfd000000, 0x78000000)
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci#define PCIIACK_SIZE		0x00100000
408c2ecf20Sopenharmony_ci#define PCIIACK_BASE		MMU_IO(0xfc000000, 0x79000000)
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#define PCICFG1_SIZE		0x01000000
438c2ecf20Sopenharmony_ci#define PCICFG1_BASE		MMU_IO(0xfb000000, 0x7a000000)
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#define PCICFG0_SIZE		0x01000000
468c2ecf20Sopenharmony_ci#define PCICFG0_BASE		MMU_IO(0xfa000000, 0x7b000000)
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci#define PCIMEM_SIZE		0x01000000
498c2ecf20Sopenharmony_ci#define PCIMEM_BASE		MMU_IO(0xf0000000, 0x80000000)
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci#define XBUS_CS2		0x40012000
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci#define XBUS_SWITCH		((volatile unsigned char *)(XBUS_BASE + 0x12000))
548c2ecf20Sopenharmony_ci#define XBUS_SWITCH_SWITCH	((*XBUS_SWITCH) & 15)
558c2ecf20Sopenharmony_ci#define XBUS_SWITCH_J17_13	((*XBUS_SWITCH) & (1 << 4))
568c2ecf20Sopenharmony_ci#define XBUS_SWITCH_J17_11	((*XBUS_SWITCH) & (1 << 5))
578c2ecf20Sopenharmony_ci#define XBUS_SWITCH_J17_9	((*XBUS_SWITCH) & (1 << 6))
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci#define UNCACHEABLE_ADDR	(ARMCSR_BASE + 0x108)	/* CSR_ROMBASEMASK */
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci/* PIC irq control */
638c2ecf20Sopenharmony_ci#define PIC_LO			0x20
648c2ecf20Sopenharmony_ci#define PIC_MASK_LO		0x21
658c2ecf20Sopenharmony_ci#define PIC_HI			0xA0
668c2ecf20Sopenharmony_ci#define PIC_MASK_HI		0xA1
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci/* GPIO pins */
698c2ecf20Sopenharmony_ci#define GPIO_CCLK		0x800
708c2ecf20Sopenharmony_ci#define GPIO_DSCLK		0x400
718c2ecf20Sopenharmony_ci#define GPIO_E2CLK		0x200
728c2ecf20Sopenharmony_ci#define GPIO_IOLOAD		0x100
738c2ecf20Sopenharmony_ci#define GPIO_RED_LED		0x080
748c2ecf20Sopenharmony_ci#define GPIO_WDTIMER		0x040
758c2ecf20Sopenharmony_ci#define GPIO_DATA		0x020
768c2ecf20Sopenharmony_ci#define GPIO_IOCLK		0x010
778c2ecf20Sopenharmony_ci#define GPIO_DONE		0x008
788c2ecf20Sopenharmony_ci#define GPIO_FAN		0x004
798c2ecf20Sopenharmony_ci#define GPIO_GREEN_LED		0x002
808c2ecf20Sopenharmony_ci#define GPIO_RESET		0x001
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci/* CPLD pins */
838c2ecf20Sopenharmony_ci#define CPLD_DS_ENABLE		8
848c2ecf20Sopenharmony_ci#define CPLD_7111_DISABLE	4
858c2ecf20Sopenharmony_ci#define CPLD_UNMUTE		2
868c2ecf20Sopenharmony_ci#define CPLD_FLASH_WR_ENABLE	1
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__
898c2ecf20Sopenharmony_ciextern raw_spinlock_t nw_gpio_lock;
908c2ecf20Sopenharmony_ciextern void nw_gpio_modify_op(unsigned int mask, unsigned int set);
918c2ecf20Sopenharmony_ciextern void nw_gpio_modify_io(unsigned int mask, unsigned int in);
928c2ecf20Sopenharmony_ciextern unsigned int nw_gpio_read(void);
938c2ecf20Sopenharmony_ciextern void nw_cpld_modify(unsigned int mask, unsigned int set);
948c2ecf20Sopenharmony_ci#endif
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci#endif
97