^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * linux/arch/arm/mach-omap1/board-palmtt.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Modified from board-palmtt2.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Modified and amended for Palm Tungsten|T
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * by Marek Vasut <marek.vasut@gmail.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/delay.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/gpio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/platform_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/notifier.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/clk.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <linux/input.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #include <linux/mtd/mtd.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <linux/mtd/partitions.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #include <linux/mtd/physmap.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include <linux/leds.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #include <linux/omapfb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #include <linux/spi/spi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #include <linux/spi/ads7846.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #include <linux/platform_data/omap1_bl.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #include <linux/platform_data/leds-omap.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #include <asm/mach-types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #include <asm/mach/arch.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #include <asm/mach/map.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #include "flash.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #include <mach/mux.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #include <linux/omap-dma.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #include <mach/tc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #include <linux/platform_data/keypad-omap.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #include <mach/hardware.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #include <mach/usb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #include "common.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #define PALMTT_USBDETECT_GPIO 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #define PALMTT_CABLE_GPIO 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #define PALMTT_LED_GPIO 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #define PALMTT_PENIRQ_GPIO 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #define PALMTT_MMC_WP_GPIO 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) #define PALMTT_HDQ_GPIO 11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) static const unsigned int palmtt_keymap[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) KEY(0, 0, KEY_ESC),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) KEY(1, 0, KEY_SPACE),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) KEY(2, 0, KEY_LEFTCTRL),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) KEY(3, 0, KEY_TAB),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) KEY(4, 0, KEY_ENTER),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) KEY(0, 1, KEY_LEFT),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) KEY(1, 1, KEY_DOWN),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) KEY(2, 1, KEY_UP),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) KEY(3, 1, KEY_RIGHT),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) KEY(0, 2, KEY_SLEEP),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) KEY(4, 2, KEY_Y),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) static struct mtd_partition palmtt_partitions[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) .name = "write8k",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) .offset = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) .size = SZ_8K,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) .mask_flags = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) .name = "PalmOS-BootLoader(ro)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) .offset = SZ_8K,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) .size = 7 * SZ_8K,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) .mask_flags = MTD_WRITEABLE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) .name = "u-boot",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) .offset = MTDPART_OFS_APPEND,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) .size = 8 * SZ_8K,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) .mask_flags = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) .name = "PalmOS-FS(ro)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) .offset = MTDPART_OFS_APPEND,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) .size = 7 * SZ_1M + 4 * SZ_64K - 16 * SZ_8K,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) .mask_flags = MTD_WRITEABLE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) .name = "u-boot(rez)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) .offset = MTDPART_OFS_APPEND,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) .size = SZ_128K,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) .mask_flags = 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) .name = "empty",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) .offset = MTDPART_OFS_APPEND,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) .size = MTDPART_SIZ_FULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) .mask_flags = 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) static struct physmap_flash_data palmtt_flash_data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) .width = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) .set_vpp = omap1_set_vpp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) .parts = palmtt_partitions,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) .nr_parts = ARRAY_SIZE(palmtt_partitions),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) static struct resource palmtt_flash_resource = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) .start = OMAP_CS0_PHYS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) .end = OMAP_CS0_PHYS + SZ_8M - 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) .flags = IORESOURCE_MEM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) static struct platform_device palmtt_flash_device = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) .name = "physmap-flash",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) .id = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) .platform_data = &palmtt_flash_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) .num_resources = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) .resource = &palmtt_flash_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) static struct resource palmtt_kp_resources[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) [0] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) .start = INT_KEYBOARD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) .end = INT_KEYBOARD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) .flags = IORESOURCE_IRQ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) static const struct matrix_keymap_data palmtt_keymap_data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) .keymap = palmtt_keymap,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) .keymap_size = ARRAY_SIZE(palmtt_keymap),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) static struct omap_kp_platform_data palmtt_kp_data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) .rows = 6,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) .cols = 3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) .keymap_data = &palmtt_keymap_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) static struct platform_device palmtt_kp_device = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) .name = "omap-keypad",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) .platform_data = &palmtt_kp_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) .num_resources = ARRAY_SIZE(palmtt_kp_resources),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) .resource = palmtt_kp_resources,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) static struct platform_device palmtt_lcd_device = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) .name = "lcd_palmtt",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) static struct platform_device palmtt_spi_device = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) .name = "spi_palmtt",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) static struct omap_backlight_config palmtt_backlight_config = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) .default_intensity = 0xa0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) static struct platform_device palmtt_backlight_device = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) .name = "omap-bl",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) .platform_data= &palmtt_backlight_config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) static struct omap_led_config palmtt_led_config[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) .cdev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) .name = "palmtt:led0",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) .gpio = PALMTT_LED_GPIO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) static struct omap_led_platform_data palmtt_led_data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) .nr_leds = ARRAY_SIZE(palmtt_led_config),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) .leds = palmtt_led_config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) static struct platform_device palmtt_led_device = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) .name = "omap-led",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) .id = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) .dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) .platform_data = &palmtt_led_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) static struct platform_device *palmtt_devices[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) &palmtt_flash_device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) &palmtt_kp_device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) &palmtt_lcd_device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) &palmtt_spi_device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) &palmtt_backlight_device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) &palmtt_led_device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) static int palmtt_get_pendown_state(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) return !gpio_get_value(6);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) static const struct ads7846_platform_data palmtt_ts_info = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) .model = 7846,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) .vref_delay_usecs = 100, /* internal, no capacitor */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) .x_plate_ohms = 419,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) .y_plate_ohms = 486,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) .get_pendown_state = palmtt_get_pendown_state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) static struct spi_board_info __initdata palmtt_boardinfo[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) /* MicroWire (bus 2) CS0 has an ads7846e */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) .modalias = "ads7846",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) .platform_data = &palmtt_ts_info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) .max_speed_hz = 120000 /* max sample rate at 3V */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) * 26 /* command + data + overhead */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) .bus_num = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) .chip_select = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) static struct omap_usb_config palmtt_usb_config __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) .register_dev = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) .hmc_mode = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) .pins[0] = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) static const struct omap_lcd_config palmtt_lcd_config __initconst = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) .ctrl_name = "internal",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) static void __init omap_mpu_wdt_mode(int mode) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) if (mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) omap_writew(0x8000, OMAP_WDT_TIMER_MODE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) omap_writew(0x00f5, OMAP_WDT_TIMER_MODE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) omap_writew(0x00a0, OMAP_WDT_TIMER_MODE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) static void __init omap_palmtt_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) /* mux pins for uarts */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) omap_cfg_reg(UART1_TX);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) omap_cfg_reg(UART1_RTS);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) omap_cfg_reg(UART2_TX);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) omap_cfg_reg(UART2_RTS);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) omap_cfg_reg(UART3_TX);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) omap_cfg_reg(UART3_RX);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) omap_mpu_wdt_mode(0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) platform_add_devices(palmtt_devices, ARRAY_SIZE(palmtt_devices));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) palmtt_boardinfo[0].irq = gpio_to_irq(6);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) spi_register_board_info(palmtt_boardinfo,ARRAY_SIZE(palmtt_boardinfo));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) omap_serial_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) omap1_usb_init(&palmtt_usb_config);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) omap_register_i2c_bus(1, 100, NULL, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) omapfb_set_lcd_config(&palmtt_lcd_config);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) .atag_offset = 0x100,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) .map_io = omap15xx_map_io,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) .init_early = omap1_init_early,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) .init_irq = omap1_init_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) .handle_irq = omap1_handle_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) .init_machine = omap_palmtt_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) .init_late = omap1_init_late,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) .init_time = omap1_timer_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) .restart = omap1_restart,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) MACHINE_END