linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: dwalker@codeaurora.org (Daniel Walker)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/7] msm: mahimahi: add mahimahi board file
Date: Thu, 20 Jan 2011 12:32:42 -0800	[thread overview]
Message-ID: <1295555565-21563-5-git-send-email-dwalker@codeaurora.org> (raw)
In-Reply-To: <1295555565-21563-1-git-send-email-dwalker@codeaurora.org>

This adds basic boot support for Nexus One (aka Mahimahi).

This code was taken from Google's tree, with slight modifications
and clean up.

Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
---
 arch/arm/mach-msm/Kconfig          |    8 ++-
 arch/arm/mach-msm/Makefile         |    1 +
 arch/arm/mach-msm/board-mahimahi.c |   20 ++---
 arch/arm/mach-msm/board-mahimahi.h |  147 ++++++++++++++++++++++++++++++++++++
 4 files changed, 164 insertions(+), 12 deletions(-)
 create mode 100644 arch/arm/mach-msm/board-mahimahi.h

diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index 5d3d9ad..0bb8173 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -27,7 +27,7 @@ config ARCH_MSM7X30
 
 config ARCH_QSD8X50
 	bool "QSD8X50"
-	select MACH_QSD8X50_SURF if !MACH_QSD8X50A_ST1_5
+	select MACH_QSD8X50_SURF if (!MACH_QSD8X50A_ST1_5 && !MACH_MAHIMAHI)
 	select ARCH_MSM_SCORPION
 	select MSM_SMD
 	select MSM_VIC
@@ -88,6 +88,12 @@ config MACH_MSM7X30_SURF
 	help
 	  Support for the Qualcomm MSM7x30 SURF eval board.
 
+config MACH_MAHIMAHI
+        depends on ARCH_QSD8X50
+        bool "HTC Passion/Nexus One"
+        help
+          Select this to support an HTC Passion/Nexus One phone.
+
 config MACH_QSD8X50_SURF
 	depends on ARCH_QSD8X50
 	bool "QSD8x50 SURF"
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 9fd3a35..a0ebce4 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -30,6 +30,7 @@ obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o
 obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o devices-msm7x30.o
 obj-$(CONFIG_ARCH_QSD8X50) += board-qsd8x50.o devices-qsd8x50.o
 obj-$(CONFIG_ARCH_MSM8X60) += board-msm8x60.o
+obj-$(CONFIG_MACH_MAHIMAHI) += board-mahimahi.o
 
 obj-$(CONFIG_ARCH_MSM7X30) += gpiomux-7x30.o gpiomux-v1.o gpiomux.o
 obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o gpiomux-v1.o gpiomux.o
diff --git a/arch/arm/mach-msm/board-mahimahi.c b/arch/arm/mach-msm/board-mahimahi.c
index aedb136..c1745c7 100644
--- a/arch/arm/mach-msm/board-mahimahi.c
+++ b/arch/arm/mach-msm/board-mahimahi.c
@@ -41,11 +41,7 @@ static uint debug_uart;
 module_param_named(debug_uart, debug_uart, uint, 0);
 
 static struct platform_device *devices[] __initdata = {
-#if !defined(CONFIG_MSM_SERIAL_DEBUGGER)
 	&msm_device_uart1,
-#endif
-	&msm_device_uart_dm1,
-	&msm_device_nand,
 };
 
 static struct msm_acpu_clock_platform_data mahimahi_clock_data = {
@@ -82,28 +78,30 @@ static void __init mahimahi_fixup(struct machine_desc *desc, struct tag *tags,
 {
 	mi->nr_banks = 2;
 	mi->bank[0].start = PHYS_OFFSET;
-	mi->bank[0].node = PHYS_TO_NID(PHYS_OFFSET);
 	mi->bank[0].size = (219*1024*1024);
 	mi->bank[1].start = MSM_HIGHMEM_BASE;
-	mi->bank[1].node = PHYS_TO_NID(MSM_HIGHMEM_BASE);
 	mi->bank[1].size = MSM_HIGHMEM_SIZE;
 }
 
 static void __init mahimahi_map_io(void)
 {
-	msm_map_common_io();
-	msm_clock_init();
+	msm_map_qsd8x50_io();
+	msm_clock_init(msm_clocks_8x50, msm_num_clocks_8x50);
+}
+
+static void __init mahimahi_init_irq(void)
+{
+	msm_init_irq();
+	msm_init_sirc();
 }
 
 extern struct sys_timer msm_timer;
 
 MACHINE_START(MAHIMAHI, "mahimahi")
-#ifdef CONFIG_MSM_DEBUG_UART
-#endif
 	.boot_params	= 0x20000100,
 	.fixup		= mahimahi_fixup,
 	.map_io		= mahimahi_map_io,
-	.init_irq	= msm_init_irq,
+	.init_irq	= mahimahi_init_irq,
 	.init_machine	= mahimahi_init,
 	.timer		= &msm_timer,
 MACHINE_END
diff --git a/arch/arm/mach-msm/board-mahimahi.h b/arch/arm/mach-msm/board-mahimahi.h
new file mode 100644
index 0000000..e2a8b14
--- /dev/null
+++ b/arch/arm/mach-msm/board-mahimahi.h
@@ -0,0 +1,147 @@
+/* arch/arm/mach-msm/board-mahimahi.h
+ *
+ * Copyright (C) 2009 HTC Corporation.
+ * Author: Haley Teng <Haley_Teng@htc.com>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+*/
+
+#ifndef __ARCH_ARM_MACH_MSM_BOARD_MAHIMAHI_H
+#define __ARCH_ARM_MACH_MSM_BOARD_MAHIMAHI_H
+
+#include <mach/board.h>
+
+#define MSM_RAM_CONSOLE_BASE	0x03A00000
+#define MSM_RAM_CONSOLE_SIZE	0x00040000
+
+#define MSM_FB_BASE		0x03B00000
+#define MSM_FB_SIZE		0x00465000
+
+#define MSM_EBI1_BANK0_BASE	0x20000000
+#define MSM_EBI1_BANK0_SIZE	0x0E000000
+
+#define MSM_GPU_MEM_BASE	0x2DB00000
+#define MSM_GPU_MEM_SIZE	0x00500000
+
+#define MSM_EBI1_BANK1_BASE	0x30000000
+#define MSM_EBI1_BANK1_SIZE	0x10000000
+
+#define MSM_PMEM_MDP_BASE	0x30000000
+#define MSM_PMEM_MDP_SIZE	0x02000000
+
+#define MSM_PMEM_ADSP_BASE	0x32000000
+#define MSM_PMEM_ADSP_SIZE	0x02900000
+
+#define MSM_PMEM_CAMERA_BASE	0x34900000
+#define MSM_PMEM_CAMERA_SIZE	0x00800000
+
+#define MSM_HIGHMEM_BASE	0x35100000
+#define MSM_HIGHMEM_SIZE	0x0AF00000
+
+#define MAHIMAHI_GPIO_PS_HOLD		25
+
+#define MAHIMAHI_GPIO_UP_INT_N		35
+#define MAHIMAHI_GPIO_UP_RESET_N	82
+#define MAHIMAHI_GPIO_LS_EN_N		119
+
+#define MAHIMAHI_GPIO_TP_INT_N		92
+#define MAHIMAHI_GPIO_TP_LS_EN		93
+#define MAHIMAHI_GPIO_TP_EN		160
+
+#define MAHIMAHI_GPIO_POWER_KEY		94
+#define MAHIMAHI_GPIO_SDMC_CD_REV0_N	153
+
+#define MAHIMAHI_GPIO_WIFI_SHUTDOWN_N	127
+#define MAHIMAHI_GPIO_WIFI_IRQ		152
+
+#define MAHIMAHI_GPIO_BALL_UP		38
+#define MAHIMAHI_GPIO_BALL_DOWN		37
+#define MAHIMAHI_GPIO_BALL_LEFT		145
+#define MAHIMAHI_GPIO_BALL_RIGHT	21
+
+#define MAHIMAHI_GPIO_BT_UART1_RTS	43
+#define MAHIMAHI_GPIO_BT_UART1_CTS	44
+#define MAHIMAHI_GPIO_BT_UART1_RX	45
+#define MAHIMAHI_GPIO_BT_UART1_TX	46
+#define MAHIMAHI_GPIO_BT_RESET_N	146
+#define MAHIMAHI_GPIO_BT_SHUTDOWN_N	128
+
+#define MAHIMAHI_GPIO_BT_WAKE		57
+#define MAHIMAHI_GPIO_BT_HOST_WAKE	86
+
+#define MAHIMAHI_GPIO_PROXIMITY_INT_N	90
+#define MAHIMAHI_GPIO_PROXIMITY_EN	120
+
+#define MAHIMAHI_GPIO_DS2482_SLP_N	87
+#define MAHIMAHI_GPIO_VIBRATOR_ON	89
+/* Compass */
+#define MAHIMAHI_REV0_GPIO_COMPASS_INT_N	36
+
+#define MAHIMAHI_GPIO_COMPASS_INT_N	153
+#define MAHIMAHI_GPIO_COMPASS_RST_N	107
+#define MAHIMAHI_PROJECT_NAME          "mahimahi"
+#define MAHIMAHI_LAYOUTS {			   \
+	{ {-1,  0, 0}, { 0, -1,  0}, {0, 0,  1} }, \
+	{ { 0, -1, 0}, { 1,  0,  0}, {0, 0, -1} }, \
+	{ { 0, -1, 0}, { 1,  0,  0}, {0, 0,  1} }, \
+	{ {-1,  0, 0}, { 0,  0, -1}, {0, 1,  0} }  \
+}
+
+/* Audio */
+#define MAHIMAHI_AUD_JACKHP_EN		157
+#define MAHIMAHI_AUD_2V5_EN		158
+#define MAHIMAHI_AUD_MICPATH_SEL	111
+#define MAHIMAHI_AUD_A1026_INT		112
+#define MAHIMAHI_AUD_A1026_WAKEUP	113
+#define MAHIMAHI_AUD_A1026_RESET	129
+#define MAHIMAHI_AUD_A1026_CLK		 -1
+#define MAHIMAHI_CDMA_XA_AUD_A1026_CLK	105
+/* NOTE: MAHIMAHI_CDMA_XB_AUD_A1026_WAKEUP on CDMA is the same GPIO as
+ * MAHIMAHI_GPIO_BATTERY_CHARGER_CURRENT on UMTS.  Also,
+ * MAHIMAHI_CDMA_XB_AUD_A1026_RESET is the same as
+ * GPIO MAHIMAHI_GPIO_35MM_KEY_INT_SHUTDOWN on UMTS.
+ */
+#define MAHIMAHI_CDMA_XB_AUD_A1026_WAKEUP	16
+#define MAHIMAHI_CDMA_XB_AUD_A1026_RESET	19
+#define MAHIMAHI_CDMA_XB_AUD_A1026_CLK	-1
+
+/* Bluetooth PCM */
+#define MAHIMAHI_BT_PCM_OUT		68
+#define MAHIMAHI_BT_PCM_IN		69
+#define MAHIMAHI_BT_PCM_SYNC		70
+#define MAHIMAHI_BT_PCM_CLK		71
+/* flash light */
+#define MAHIMAHI_GPIO_FLASHLIGHT_TORCH	58
+#define MAHIMAHI_GPIO_FLASHLIGHT_FLASH	84
+
+#define MAHIMAHI_GPIO_LED_3V3_EN	85
+#define MAHIMAHI_GPIO_LCD_RST_N		29
+
+/* 3.5mm remote control key interrupt shutdown signal */
+#define MAHIMAHI_GPIO_35MM_KEY_INT_SHUTDOWN	19
+
+#define MAHIMAHI_GPIO_DOCK		106
+
+/* speaker amplifier enable pin for mahimahi CDMA version */
+#define MAHIMAHI_CDMA_GPIO_AUD_SPK_AMP_EN	104
+
+#define MAHIMAHI_GPIO_BATTERY_DETECTION		39
+#define MAHIMAHI_GPIO_BATTERY_CHARGER_EN	22
+#define MAHIMAHI_GPIO_BATTERY_CHARGER_CURRENT	16
+
+#define MAHIMAHI_CDMA_GPIO_BT_WAKE		28
+#define MAHIMAHI_CDMA_GPIO_FLASHLIGHT_TORCH	26
+
+#define MAHIMAHI_CDMA_SD_2V85_EN		100
+#define MAHIMAHI_CDMA_JOG_2V6_EN		150
+
+#define is_cdma_version(rev) (((rev) & 0xF0) == 0xC0)
+
+#endif /* __ARCH_ARM_MACH_MSM_BOARD_MAHIMAHI_H */
-- 
1.7.0.4

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  parent reply	other threads:[~2011-01-20 20:32 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20 20:32 [PATCH 0/7] Nexus One Support Daniel Walker
2011-01-20 20:32 ` [PATCH 1/7] msm: qsd8x50: add uart platform data Daniel Walker
2011-01-20 20:32 ` [PATCH 2/7] [ARM] msm: qsd8k memory base is at 0x20000000 Daniel Walker
2011-01-20 20:32 ` [PATCH 3/7] msm: qsd8x50: add acpuclock code Daniel Walker
2011-01-20 20:32 ` Daniel Walker [this message]
2011-01-20 20:32 ` [PATCH 5/7] msm: mahimahi: add in mmc support code Daniel Walker
2011-01-20 20:32 ` [PATCH 6/7] msm: mahimahi: add gpio pin muxing code Daniel Walker
2011-01-20 20:32 ` [PATCH 7/7] msm: mahimahi: initialize mmc at start up Daniel Walker
2011-01-21  0:42 ` [PATCH 0/7] Nexus One Support Dima Zavin
2011-01-21  0:55   ` Daniel Walker
2011-01-21  1:41     ` Joe Perches
2011-01-21  1:58       ` Daniel Walker
2011-01-21  2:13         ` Dima Zavin
2011-01-21 15:47           ` Daniel Walker
2011-01-21  2:25         ` Joe Perches
2011-01-21  3:41           ` Theodore Tso
2011-01-21 15:46           ` Daniel Walker
2011-01-21 17:48             ` Jesse Barnes
2011-01-21 17:56               ` Daniel Walker
2011-01-21 17:59                 ` Christoph Hellwig
2011-01-21 17:56               ` Jesse Barnes
2011-01-21 18:00                 ` Daniel Walker
2011-01-21 18:04                   ` Jesse Barnes
2011-01-21 18:18                     ` Daniel Walker
2011-01-21 18:27                       ` Jesse Barnes
2011-01-21 18:35                         ` Daniel Walker
2011-01-21 20:44                       ` Dima Zavin
2011-01-21 20:49                         ` Daniel Walker
2011-01-21 21:01                           ` Jesse Barnes
2011-01-21 21:26                             ` Daniel Walker
2011-01-21 21:42                               ` Dima Zavin
2011-01-22 13:58                                 ` David Woodhouse
2011-01-21 21:02                           ` Joe Perches
2011-01-21 21:24                             ` Daniel Walker
2011-01-22 11:18                               ` Pekka Enberg
2011-01-22 12:20                                 ` Russell King - ARM Linux
2011-01-22 18:06                                   ` Dima Zavin
2011-01-22 18:49                                     ` Russell King - ARM Linux
2011-01-22 20:50                                       ` Christoph Hellwig
2011-01-22 19:22                                   ` Brian Swetland
2011-01-22 19:49                                     ` Nicolas Pitre
2011-01-22 19:59                                       ` Brian Swetland
2011-01-22 20:53                                     ` Christoph Hellwig
2011-01-22 21:04                                     ` Russell King - ARM Linux
2011-01-22 21:57                                       ` Alan Cox
2011-01-23  2:38                                     ` David Woodhouse
2011-01-22 20:41                                   ` Christoph Hellwig
2011-01-21 21:05                           ` Pekka Enberg
2011-01-21 21:17                             ` Joe Perches
2011-01-21 23:49                             ` Ted Ts'o
2011-01-22  0:03                               ` Daniel Walker
2011-01-22  1:58                                 ` Steven Rostedt
2011-01-22  2:13                                   ` Daniel Walker
2011-01-22  2:32                                     ` Steven Rostedt
2011-01-22  2:31                                 ` Ted Ts'o
2011-01-22  8:19                               ` Pekka Enberg
2011-01-22 10:35                                 ` Dima Zavin
2011-01-22 10:45                                   ` Anca Emanuel
2011-01-22 11:03                                     ` Pekka Enberg
2011-01-22 11:15                                   ` Pekka Enberg
2011-01-22 17:28                                     ` Thomas Gleixner
2011-01-22 18:07                                       ` Denis 'GNUtoo' Carikli
2011-01-22 18:15                                         ` Dima Zavin
2011-01-22 20:55                                 ` Christoph Hellwig
2011-01-22 21:56                                   ` Pekka Enberg
2011-01-22 21:58                                     ` Christoph Hellwig
2011-01-22 22:13                                       ` Pekka Enberg
2011-02-04 13:36 ` Pavel Machek
2011-02-07 17:36   ` Daniel Walker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1295555565-21563-5-git-send-email-dwalker@codeaurora.org \
    --to=dwalker@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).