162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Definitions for Compaq iPAQ H3100 and H3600 handheld computers
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * (c) 2000 Compaq Computer Corporation. (Author: Jamey Hicks)
662306a36Sopenharmony_ci * (c) 2009 Dmitry Artamonow <mad_soft@inbox.ru>
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#ifndef _INCLUDE_H3XXX_H_
1062306a36Sopenharmony_ci#define _INCLUDE_H3XXX_H_
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#include "hardware.h" /* Gives GPIO_MAX */
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci/* Physical memory regions corresponding to chip selects */
1562306a36Sopenharmony_ci#define H3600_EGPIO_PHYS	(SA1100_CS5_PHYS + 0x01000000)
1662306a36Sopenharmony_ci#define H3600_BANK_2_PHYS	SA1100_CS2_PHYS
1762306a36Sopenharmony_ci#define H3600_BANK_4_PHYS	SA1100_CS4_PHYS
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci/* Virtual memory regions corresponding to chip selects 2 & 4 (used on sleeves) */
2062306a36Sopenharmony_ci#define H3600_EGPIO_VIRT	0xf0000000
2162306a36Sopenharmony_ci#define H3600_BANK_2_VIRT	0xf1000000
2262306a36Sopenharmony_ci#define H3600_BANK_4_VIRT	0xf3800000
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci/*
2562306a36Sopenharmony_ci * gpiolib numbers for all iPAQs
2662306a36Sopenharmony_ci */
2762306a36Sopenharmony_ci#define H3XXX_GPIO_PWR_BUTTON		0
2862306a36Sopenharmony_ci#define H3XXX_GPIO_PCMCIA_CD1		10
2962306a36Sopenharmony_ci#define H3XXX_GPIO_PCMCIA_IRQ1		11
3062306a36Sopenharmony_ci#define H3XXX_GPIO_PCMCIA_CD0		17
3162306a36Sopenharmony_ci#define H3XXX_GPIO_ACTION_BUTTON	18
3262306a36Sopenharmony_ci#define H3XXX_GPIO_SYS_CLK		19
3362306a36Sopenharmony_ci#define H3XXX_GPIO_PCMCIA_IRQ0		21
3462306a36Sopenharmony_ci#define H3XXX_GPIO_COM_DCD		23
3562306a36Sopenharmony_ci#define H3XXX_GPIO_OPTION		24
3662306a36Sopenharmony_ci#define H3XXX_GPIO_COM_CTS		25
3762306a36Sopenharmony_ci#define H3XXX_GPIO_COM_RTS		26
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci/* machine-specific gpios */
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci#define H3100_GPIO_BT_ON		2
4262306a36Sopenharmony_ci#define H3100_GPIO_QMUTE		4
4362306a36Sopenharmony_ci#define H3100_GPIO_LCD_3V_ON		5
4462306a36Sopenharmony_ci#define H3100_GPIO_AUD_ON		6
4562306a36Sopenharmony_ci#define H3100_GPIO_AUD_PWR_ON		7
4662306a36Sopenharmony_ci#define H3100_GPIO_IR_ON		8
4762306a36Sopenharmony_ci#define H3100_GPIO_IR_FSEL		9
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci#define H3600_GPIO_CLK_SET0		12	/* audio sample rate clock generator */
5062306a36Sopenharmony_ci#define H3600_GPIO_CLK_SET1		13
5162306a36Sopenharmony_ci#define H3600_GPIO_SOFT_RESET		20	/* also known as BATT_FAULT */
5262306a36Sopenharmony_ci#define H3600_GPIO_OPT_LOCK		22
5362306a36Sopenharmony_ci#define H3600_GPIO_OPT_DET		27
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci/* H3100 / 3600 EGPIO pins */
5762306a36Sopenharmony_ci#define H3XXX_EGPIO_BASE		(GPIO_MAX + 1)
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci#define H3XXX_EGPIO_VPP_ON		(H3XXX_EGPIO_BASE + 0)
6062306a36Sopenharmony_ci#define H3XXX_EGPIO_CARD_RESET		(H3XXX_EGPIO_BASE + 1) /* reset the attached pcmcia/compactflash card.  active high. */
6162306a36Sopenharmony_ci#define H3XXX_EGPIO_OPT_RESET		(H3XXX_EGPIO_BASE + 2) /* reset the attached option pack.  active high. */
6262306a36Sopenharmony_ci#define H3XXX_EGPIO_CODEC_NRESET	(H3XXX_EGPIO_BASE + 3) /* reset the onboard UDA1341.  active low. */
6362306a36Sopenharmony_ci#define H3XXX_EGPIO_OPT_NVRAM_ON	(H3XXX_EGPIO_BASE + 4) /* apply power to optionpack nvram, active high. */
6462306a36Sopenharmony_ci#define H3XXX_EGPIO_OPT_ON		(H3XXX_EGPIO_BASE + 5) /* full power to option pack.  active high. */
6562306a36Sopenharmony_ci#define H3XXX_EGPIO_LCD_ON		(H3XXX_EGPIO_BASE + 6) /* enable 3.3V to LCD.  active high. */
6662306a36Sopenharmony_ci#define H3XXX_EGPIO_RS232_ON		(H3XXX_EGPIO_BASE + 7) /* UART3 transceiver force on.  Active high. */
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci/* H3600 only EGPIO pins */
6962306a36Sopenharmony_ci#define H3600_EGPIO_LCD_PCI		(H3XXX_EGPIO_BASE + 8) /* LCD control IC enable.  active high. */
7062306a36Sopenharmony_ci#define H3600_EGPIO_IR_ON		(H3XXX_EGPIO_BASE + 9) /* apply power to IR module.  active high. */
7162306a36Sopenharmony_ci#define H3600_EGPIO_AUD_AMP_ON		(H3XXX_EGPIO_BASE + 10) /* apply power to audio power amp.  active high. */
7262306a36Sopenharmony_ci#define H3600_EGPIO_AUD_PWR_ON		(H3XXX_EGPIO_BASE + 11) /* apply power to reset of audio circuit.  active high. */
7362306a36Sopenharmony_ci#define H3600_EGPIO_QMUTE		(H3XXX_EGPIO_BASE + 12) /* mute control for onboard UDA1341.  active high. */
7462306a36Sopenharmony_ci#define H3600_EGPIO_IR_FSEL		(H3XXX_EGPIO_BASE + 13) /* IR speed select: 1->fast, 0->slow */
7562306a36Sopenharmony_ci#define H3600_EGPIO_LCD_5V_ON		(H3XXX_EGPIO_BASE + 14) /* enable 5V to LCD. active high. */
7662306a36Sopenharmony_ci#define H3600_EGPIO_LVDD_ON		(H3XXX_EGPIO_BASE + 15) /* enable 9V and -6.5V to LCD. */
7762306a36Sopenharmony_ci
7862306a36Sopenharmony_civoid __init h3xxx_map_io(void);
7962306a36Sopenharmony_civoid __init h3xxx_mach_init(void);
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci#endif /* _INCLUDE_H3XXX_H_ */
82