18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Hardware specific definitions for Sharp SL-C6000x series of PDAs
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (c) 2005 Dirk Opfer
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Based on Sharp's 2.4 kernel patches
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci#ifndef _ASM_ARCH_TOSA_H_
108c2ecf20Sopenharmony_ci#define _ASM_ARCH_TOSA_H_ 1
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include "irqs.h" /* PXA_NR_BUILTIN_GPIO */
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci/*  TOSA Chip selects  */
158c2ecf20Sopenharmony_ci#define TOSA_LCDC_PHYS		PXA_CS4_PHYS
168c2ecf20Sopenharmony_ci/* Internel Scoop */
178c2ecf20Sopenharmony_ci#define TOSA_CF_PHYS		(PXA_CS2_PHYS + 0x00800000)
188c2ecf20Sopenharmony_ci/* Jacket Scoop */
198c2ecf20Sopenharmony_ci#define TOSA_SCOOP_PHYS  	(PXA_CS5_PHYS + 0x00800000)
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define TOSA_NR_IRQS		(IRQ_BOARD_START + TC6393XB_NR_IRQS)
228c2ecf20Sopenharmony_ci/*
238c2ecf20Sopenharmony_ci * SCOOP2 internal GPIOs
248c2ecf20Sopenharmony_ci */
258c2ecf20Sopenharmony_ci#define TOSA_SCOOP_GPIO_BASE		PXA_NR_BUILTIN_GPIO
268c2ecf20Sopenharmony_ci#define TOSA_SCOOP_PXA_VCORE1		SCOOP_GPCR_PA11
278c2ecf20Sopenharmony_ci#define TOSA_GPIO_TC6393XB_REST_IN	(TOSA_SCOOP_GPIO_BASE + 1)
288c2ecf20Sopenharmony_ci#define TOSA_GPIO_IR_POWERDWN		(TOSA_SCOOP_GPIO_BASE + 2)
298c2ecf20Sopenharmony_ci#define TOSA_GPIO_SD_WP			(TOSA_SCOOP_GPIO_BASE + 3)
308c2ecf20Sopenharmony_ci#define TOSA_GPIO_PWR_ON		(TOSA_SCOOP_GPIO_BASE + 4)
318c2ecf20Sopenharmony_ci#define TOSA_SCOOP_AUD_PWR_ON		SCOOP_GPCR_PA16
328c2ecf20Sopenharmony_ci#define TOSA_GPIO_BT_RESET		(TOSA_SCOOP_GPIO_BASE + 6)
338c2ecf20Sopenharmony_ci#define TOSA_GPIO_BT_PWR_EN		(TOSA_SCOOP_GPIO_BASE + 7)
348c2ecf20Sopenharmony_ci#define TOSA_SCOOP_AC_IN_OL		SCOOP_GPCR_PA19
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci/* GPIO Direction   1 : output mode / 0:input mode */
378c2ecf20Sopenharmony_ci#define TOSA_SCOOP_IO_DIR     (TOSA_SCOOP_PXA_VCORE1 | \
388c2ecf20Sopenharmony_ci		TOSA_SCOOP_AUD_PWR_ON)
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci/*
418c2ecf20Sopenharmony_ci * SCOOP2 jacket GPIOs
428c2ecf20Sopenharmony_ci */
438c2ecf20Sopenharmony_ci#define TOSA_SCOOP_JC_GPIO_BASE		(PXA_NR_BUILTIN_GPIO + 12)
448c2ecf20Sopenharmony_ci#define TOSA_GPIO_BT_LED		(TOSA_SCOOP_JC_GPIO_BASE + 0)
458c2ecf20Sopenharmony_ci#define TOSA_GPIO_NOTE_LED		(TOSA_SCOOP_JC_GPIO_BASE + 1)
468c2ecf20Sopenharmony_ci#define TOSA_GPIO_CHRG_ERR_LED		(TOSA_SCOOP_JC_GPIO_BASE + 2)
478c2ecf20Sopenharmony_ci#define TOSA_GPIO_USB_PULLUP		(TOSA_SCOOP_JC_GPIO_BASE + 3)
488c2ecf20Sopenharmony_ci#define TOSA_GPIO_TC6393XB_SUSPEND	(TOSA_SCOOP_JC_GPIO_BASE + 4)
498c2ecf20Sopenharmony_ci#define TOSA_GPIO_TC6393XB_L3V_ON	(TOSA_SCOOP_JC_GPIO_BASE + 5)
508c2ecf20Sopenharmony_ci#define TOSA_SCOOP_JC_WLAN_DETECT	SCOOP_GPCR_PA17
518c2ecf20Sopenharmony_ci#define TOSA_GPIO_WLAN_LED		(TOSA_SCOOP_JC_GPIO_BASE + 7)
528c2ecf20Sopenharmony_ci#define TOSA_SCOOP_JC_CARD_LIMIT_SEL	SCOOP_GPCR_PA19
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci/* GPIO Direction   1 : output mode / 0:input mode */
558c2ecf20Sopenharmony_ci#define TOSA_SCOOP_JC_IO_DIR (TOSA_SCOOP_JC_CARD_LIMIT_SEL)
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci/*
588c2ecf20Sopenharmony_ci * TC6393XB GPIOs
598c2ecf20Sopenharmony_ci */
608c2ecf20Sopenharmony_ci#define TOSA_TC6393XB_GPIO_BASE		(PXA_NR_BUILTIN_GPIO + 2 * 12)
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci#define TOSA_GPIO_TG_ON			(TOSA_TC6393XB_GPIO_BASE + 0)
638c2ecf20Sopenharmony_ci#define TOSA_GPIO_L_MUTE		(TOSA_TC6393XB_GPIO_BASE + 1)
648c2ecf20Sopenharmony_ci#define TOSA_GPIO_BL_C20MA		(TOSA_TC6393XB_GPIO_BASE + 3)
658c2ecf20Sopenharmony_ci#define TOSA_GPIO_CARD_VCC_ON		(TOSA_TC6393XB_GPIO_BASE + 4)
668c2ecf20Sopenharmony_ci#define TOSA_GPIO_CHARGE_OFF		(TOSA_TC6393XB_GPIO_BASE + 6)
678c2ecf20Sopenharmony_ci#define TOSA_GPIO_CHARGE_OFF_JC		(TOSA_TC6393XB_GPIO_BASE + 7)
688c2ecf20Sopenharmony_ci#define TOSA_GPIO_BAT0_V_ON		(TOSA_TC6393XB_GPIO_BASE + 9)
698c2ecf20Sopenharmony_ci#define TOSA_GPIO_BAT1_V_ON		(TOSA_TC6393XB_GPIO_BASE + 10)
708c2ecf20Sopenharmony_ci#define TOSA_GPIO_BU_CHRG_ON		(TOSA_TC6393XB_GPIO_BASE + 11)
718c2ecf20Sopenharmony_ci#define TOSA_GPIO_BAT_SW_ON		(TOSA_TC6393XB_GPIO_BASE + 12)
728c2ecf20Sopenharmony_ci#define TOSA_GPIO_BAT0_TH_ON		(TOSA_TC6393XB_GPIO_BASE + 14)
738c2ecf20Sopenharmony_ci#define TOSA_GPIO_BAT1_TH_ON		(TOSA_TC6393XB_GPIO_BASE + 15)
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci/*
768c2ecf20Sopenharmony_ci * PXA GPIOs
778c2ecf20Sopenharmony_ci */
788c2ecf20Sopenharmony_ci#define TOSA_GPIO_POWERON		(0)
798c2ecf20Sopenharmony_ci#define TOSA_GPIO_RESET			(1)
808c2ecf20Sopenharmony_ci#define TOSA_GPIO_AC_IN			(2)
818c2ecf20Sopenharmony_ci#define TOSA_GPIO_RECORD_BTN		(3)
828c2ecf20Sopenharmony_ci#define TOSA_GPIO_SYNC			(4)	/* Cradle SYNC Button */
838c2ecf20Sopenharmony_ci#define TOSA_GPIO_USB_IN		(5)
848c2ecf20Sopenharmony_ci#define TOSA_GPIO_JACKET_DETECT		(7)
858c2ecf20Sopenharmony_ci#define TOSA_GPIO_nSD_DETECT		(9)
868c2ecf20Sopenharmony_ci#define TOSA_GPIO_nSD_INT		(10)
878c2ecf20Sopenharmony_ci#define TOSA_GPIO_TC6393XB_CLK		(11)
888c2ecf20Sopenharmony_ci#define TOSA_GPIO_BAT1_CRG		(12)
898c2ecf20Sopenharmony_ci#define TOSA_GPIO_CF_CD			(13)
908c2ecf20Sopenharmony_ci#define TOSA_GPIO_BAT0_CRG		(14)
918c2ecf20Sopenharmony_ci#define TOSA_GPIO_TC6393XB_INT		(15)
928c2ecf20Sopenharmony_ci#define TOSA_GPIO_BAT0_LOW		(17)
938c2ecf20Sopenharmony_ci#define TOSA_GPIO_TC6393XB_RDY		(18)
948c2ecf20Sopenharmony_ci#define TOSA_GPIO_ON_RESET		(19)
958c2ecf20Sopenharmony_ci#define TOSA_GPIO_EAR_IN		(20)
968c2ecf20Sopenharmony_ci#define TOSA_GPIO_CF_IRQ		(21)	/* CF slot0 Ready */
978c2ecf20Sopenharmony_ci#define TOSA_GPIO_ON_KEY		(22)
988c2ecf20Sopenharmony_ci#define TOSA_GPIO_VGA_LINE		(27)
998c2ecf20Sopenharmony_ci#define TOSA_GPIO_TP_INT		(32)	/* Touch Panel pen down interrupt */
1008c2ecf20Sopenharmony_ci#define TOSA_GPIO_JC_CF_IRQ		(36)	/* CF slot1 Ready */
1018c2ecf20Sopenharmony_ci#define TOSA_GPIO_BAT_LOCKED		(38)	/* Battery locked */
1028c2ecf20Sopenharmony_ci#define TOSA_GPIO_IRDA_TX		(47)
1038c2ecf20Sopenharmony_ci#define TOSA_GPIO_TG_SPI_SCLK		(81)
1048c2ecf20Sopenharmony_ci#define TOSA_GPIO_TG_SPI_CS		(82)
1058c2ecf20Sopenharmony_ci#define TOSA_GPIO_TG_SPI_MOSI		(83)
1068c2ecf20Sopenharmony_ci#define TOSA_GPIO_BAT1_LOW		(84)
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci#define TOSA_GPIO_HP_IN			GPIO_EAR_IN
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci#define TOSA_GPIO_MAIN_BAT_LOW		GPIO_BAT0_LOW
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci#define TOSA_KEY_STROBE_NUM		(11)
1138c2ecf20Sopenharmony_ci#define TOSA_KEY_SENSE_NUM		(7)
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci#define TOSA_GPIO_HIGH_STROBE_BIT	(0xfc000000)
1168c2ecf20Sopenharmony_ci#define TOSA_GPIO_LOW_STROBE_BIT	(0x0000001f)
1178c2ecf20Sopenharmony_ci#define TOSA_GPIO_ALL_SENSE_BIT		(0x00000fe0)
1188c2ecf20Sopenharmony_ci#define TOSA_GPIO_ALL_SENSE_RSHIFT	(5)
1198c2ecf20Sopenharmony_ci#define TOSA_GPIO_STROBE_BIT(a)		GPIO_bit(58+(a))
1208c2ecf20Sopenharmony_ci#define TOSA_GPIO_SENSE_BIT(a)		GPIO_bit(69+(a))
1218c2ecf20Sopenharmony_ci#define TOSA_GAFR_HIGH_STROBE_BIT	(0xfff00000)
1228c2ecf20Sopenharmony_ci#define TOSA_GAFR_LOW_STROBE_BIT	(0x000003ff)
1238c2ecf20Sopenharmony_ci#define TOSA_GAFR_ALL_SENSE_BIT		(0x00fffc00)
1248c2ecf20Sopenharmony_ci#define TOSA_GPIO_KEY_SENSE(a) 		(69+(a))
1258c2ecf20Sopenharmony_ci#define TOSA_GPIO_KEY_STROBE(a)		(58+(a))
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci/*
1288c2ecf20Sopenharmony_ci * Interrupts
1298c2ecf20Sopenharmony_ci */
1308c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_WAKEUP        	PXA_GPIO_TO_IRQ(TOSA_GPIO_WAKEUP)
1318c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_AC_IN         	PXA_GPIO_TO_IRQ(TOSA_GPIO_AC_IN)
1328c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_RECORD_BTN    	PXA_GPIO_TO_IRQ(TOSA_GPIO_RECORD_BTN)
1338c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_SYNC          	PXA_GPIO_TO_IRQ(TOSA_GPIO_SYNC)
1348c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_USB_IN        	PXA_GPIO_TO_IRQ(TOSA_GPIO_USB_IN)
1358c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_JACKET_DETECT 	PXA_GPIO_TO_IRQ(TOSA_GPIO_JACKET_DETECT)
1368c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_nSD_INT       	PXA_GPIO_TO_IRQ(TOSA_GPIO_nSD_INT)
1378c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_nSD_DETECT    	PXA_GPIO_TO_IRQ(TOSA_GPIO_nSD_DETECT)
1388c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_BAT1_CRG      	PXA_GPIO_TO_IRQ(TOSA_GPIO_BAT1_CRG)
1398c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_CF_CD         	PXA_GPIO_TO_IRQ(TOSA_GPIO_CF_CD)
1408c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_BAT0_CRG      	PXA_GPIO_TO_IRQ(TOSA_GPIO_BAT0_CRG)
1418c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_TC6393XB_INT    	PXA_GPIO_TO_IRQ(TOSA_GPIO_TC6393XB_INT)
1428c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_BAT0_LOW      	PXA_GPIO_TO_IRQ(TOSA_GPIO_BAT0_LOW)
1438c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_EAR_IN        	PXA_GPIO_TO_IRQ(TOSA_GPIO_EAR_IN)
1448c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_CF_IRQ        	PXA_GPIO_TO_IRQ(TOSA_GPIO_CF_IRQ)
1458c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_ON_KEY        	PXA_GPIO_TO_IRQ(TOSA_GPIO_ON_KEY)
1468c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_VGA_LINE      	PXA_GPIO_TO_IRQ(TOSA_GPIO_VGA_LINE)
1478c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_TP_INT        	PXA_GPIO_TO_IRQ(TOSA_GPIO_TP_INT)
1488c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_JC_CF_IRQ     	PXA_GPIO_TO_IRQ(TOSA_GPIO_JC_CF_IRQ)
1498c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_BAT_LOCKED    	PXA_GPIO_TO_IRQ(TOSA_GPIO_BAT_LOCKED)
1508c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_BAT1_LOW      	PXA_GPIO_TO_IRQ(TOSA_GPIO_BAT1_LOW)
1518c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_KEY_SENSE(a)  	PXA_GPIO_TO_IRQ(69+(a))
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci#define TOSA_IRQ_GPIO_MAIN_BAT_LOW 	PXA_GPIO_TO_IRQ(TOSA_GPIO_MAIN_BAT_LOW)
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci#define TOSA_KEY_SYNC		KEY_102ND /* ??? */
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci#ifndef CONFIG_TOSA_USE_EXT_KEYCODES
1588c2ecf20Sopenharmony_ci#define TOSA_KEY_RECORD		KEY_YEN
1598c2ecf20Sopenharmony_ci#define TOSA_KEY_ADDRESSBOOK	KEY_KATAKANA
1608c2ecf20Sopenharmony_ci#define TOSA_KEY_CANCEL		KEY_ESC
1618c2ecf20Sopenharmony_ci#define TOSA_KEY_CENTER		KEY_HIRAGANA
1628c2ecf20Sopenharmony_ci#define TOSA_KEY_OK		KEY_HENKAN
1638c2ecf20Sopenharmony_ci#define TOSA_KEY_CALENDAR	KEY_KATAKANAHIRAGANA
1648c2ecf20Sopenharmony_ci#define TOSA_KEY_HOMEPAGE	KEY_HANGEUL
1658c2ecf20Sopenharmony_ci#define TOSA_KEY_LIGHT		KEY_MUHENKAN
1668c2ecf20Sopenharmony_ci#define TOSA_KEY_MENU		KEY_HANJA
1678c2ecf20Sopenharmony_ci#define TOSA_KEY_FN		KEY_RIGHTALT
1688c2ecf20Sopenharmony_ci#define TOSA_KEY_MAIL		KEY_ZENKAKUHANKAKU
1698c2ecf20Sopenharmony_ci#else
1708c2ecf20Sopenharmony_ci#define TOSA_KEY_RECORD		KEY_RECORD
1718c2ecf20Sopenharmony_ci#define TOSA_KEY_ADDRESSBOOK	KEY_ADDRESSBOOK
1728c2ecf20Sopenharmony_ci#define TOSA_KEY_CANCEL		KEY_CANCEL
1738c2ecf20Sopenharmony_ci#define TOSA_KEY_CENTER		KEY_SELECT /* ??? */
1748c2ecf20Sopenharmony_ci#define TOSA_KEY_OK		KEY_OK
1758c2ecf20Sopenharmony_ci#define TOSA_KEY_CALENDAR	KEY_CALENDAR
1768c2ecf20Sopenharmony_ci#define TOSA_KEY_HOMEPAGE	KEY_HOMEPAGE
1778c2ecf20Sopenharmony_ci#define TOSA_KEY_LIGHT		KEY_KBDILLUMTOGGLE
1788c2ecf20Sopenharmony_ci#define TOSA_KEY_MENU		KEY_MENU
1798c2ecf20Sopenharmony_ci#define TOSA_KEY_FN		KEY_FN
1808c2ecf20Sopenharmony_ci#define TOSA_KEY_MAIL		KEY_MAIL
1818c2ecf20Sopenharmony_ci#endif
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci#endif /* _ASM_ARCH_TOSA_H_ */
184