18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci *  Copyright (C) 2004 IDT Inc.
58c2ecf20Sopenharmony_ci *  Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci#ifndef __ASM_RC32434_RB_H
88c2ecf20Sopenharmony_ci#define __ASM_RC32434_RB_H
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#include <linux/genhd.h>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#define REGBASE		0x18000000
138c2ecf20Sopenharmony_ci#define IDT434_REG_BASE ((volatile void *) KSEG1ADDR(REGBASE))
148c2ecf20Sopenharmony_ci#define UART0BASE	0x58000
158c2ecf20Sopenharmony_ci#define RST		(1 << 15)
168c2ecf20Sopenharmony_ci#define DEV0BASE	0x010000
178c2ecf20Sopenharmony_ci#define DEV0MASK	0x010004
188c2ecf20Sopenharmony_ci#define DEV0C		0x010008
198c2ecf20Sopenharmony_ci#define DEV0T		0x01000C
208c2ecf20Sopenharmony_ci#define DEV1BASE	0x010010
218c2ecf20Sopenharmony_ci#define DEV1MASK	0x010014
228c2ecf20Sopenharmony_ci#define DEV1C		0x010018
238c2ecf20Sopenharmony_ci#define DEV1TC		0x01001C
248c2ecf20Sopenharmony_ci#define DEV2BASE	0x010020
258c2ecf20Sopenharmony_ci#define DEV2MASK	0x010024
268c2ecf20Sopenharmony_ci#define DEV2C		0x010028
278c2ecf20Sopenharmony_ci#define DEV2TC		0x01002C
288c2ecf20Sopenharmony_ci#define DEV3BASE	0x010030
298c2ecf20Sopenharmony_ci#define DEV3MASK	0x010034
308c2ecf20Sopenharmony_ci#define DEV3C		0x010038
318c2ecf20Sopenharmony_ci#define DEV3TC		0x01003C
328c2ecf20Sopenharmony_ci#define BTCS		0x010040
338c2ecf20Sopenharmony_ci#define BTCOMPARE	0x010044
348c2ecf20Sopenharmony_ci#define GPIOBASE	0x050000
358c2ecf20Sopenharmony_ci/* Offsets relative to GPIOBASE */
368c2ecf20Sopenharmony_ci#define GPIOFUNC	0x00
378c2ecf20Sopenharmony_ci#define GPIOCFG		0x04
388c2ecf20Sopenharmony_ci#define GPIOD		0x08
398c2ecf20Sopenharmony_ci#define GPIOILEVEL	0x0C
408c2ecf20Sopenharmony_ci#define GPIOISTAT	0x10
418c2ecf20Sopenharmony_ci#define GPIONMIEN	0x14
428c2ecf20Sopenharmony_ci#define IMASK6		0x38
438c2ecf20Sopenharmony_ci#define LO_WPX		(1 << 0)
448c2ecf20Sopenharmony_ci#define LO_ALE		(1 << 1)
458c2ecf20Sopenharmony_ci#define LO_CLE		(1 << 2)
468c2ecf20Sopenharmony_ci#define LO_CEX		(1 << 3)
478c2ecf20Sopenharmony_ci#define LO_FOFF		(1 << 5)
488c2ecf20Sopenharmony_ci#define LO_SPICS	(1 << 6)
498c2ecf20Sopenharmony_ci#define LO_ULED		(1 << 7)
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci#define BIT_TO_MASK(x)	(1 << x)
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_cistruct dev_reg {
548c2ecf20Sopenharmony_ci	u32	base;
558c2ecf20Sopenharmony_ci	u32	mask;
568c2ecf20Sopenharmony_ci	u32	ctl;
578c2ecf20Sopenharmony_ci	u32	timing;
588c2ecf20Sopenharmony_ci};
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_cistruct korina_device {
618c2ecf20Sopenharmony_ci	char *name;
628c2ecf20Sopenharmony_ci	unsigned char mac[6];
638c2ecf20Sopenharmony_ci	struct net_device *dev;
648c2ecf20Sopenharmony_ci};
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_cistruct mpmc_device {
678c2ecf20Sopenharmony_ci	unsigned char	state;
688c2ecf20Sopenharmony_ci	spinlock_t	lock;
698c2ecf20Sopenharmony_ci	void __iomem	*base;
708c2ecf20Sopenharmony_ci};
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ciextern void set_latch_u5(unsigned char or_mask, unsigned char nand_mask);
738c2ecf20Sopenharmony_ciextern unsigned char get_latch_u5(void);
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci#endif	/* __ASM_RC32434_RB_H */
76