Skip to contentSkip to conversation

arm: msm: fix up very basic HTC Sapphire support

PATCH In review Daniel Walker 3 participants 7 messages Apr 12, 2012 – May 12, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 arm: msm: fix up very basic HTC Sapphire support

Adds sapphire into the make file, and fixes all the code problems that prevented it from building (including adding board-sapphire.h)

---
 arch/arm/mach-msm/Kconfig          |   10 +-
 arch/arm/mach-msm/Makefile         |    1 +
 arch/arm/mach-msm/board-sapphire.c |   18 +--
 arch/arm/mach-msm/board-sapphire.h |  224 ++++++++++++++++++++++++++++++++++++
 4 files changed, 235 insertions(+), 18 deletions(-)
 create mode 100644 arch/arm/mach-msm/board-sapphire.h
arch/arm/mach-msm/Kconfig +9 -1
index 1cd40ad..04f3b8e 100644
@@ -6,7 +6,6 @@ choice
 
 config ARCH_MSM7X00A
 	bool "MSM7x00A / MSM7x01A"
-	select MACH_TROUT if !MACH_HALIBUT
 	select ARCH_MSM_ARM11
 	select MSM_SMD
 	select MSM_SMD_PKG3
@@ -80,6 +79,7 @@ config  MSM_VIC
 menu "Qualcomm MSM Board Type"
 
 config MACH_HALIBUT
+	select MACH_TROUT if !MACH_SAPPHIRE && !MACH_HALIBUT
 	depends on ARCH_MSM
 	depends on ARCH_MSM7X00A
 	bool "Halibut Board (QCT SURF7201A)"
@@ -93,6 +93,14 @@ config MACH_TROUT
 	help
 	  Support for the HTC Dream, T-Mobile G1, Android ADP1 devices.
 
+config MACH_SAPPHIRE
+	select MACH_TROUT if !MACH_HALIBUT && !MACH_SAPPHIRE
+	depends on ARCH_MSM
+	depends on ARCH_MSM7X00A
+	bool "HTC Sapphire"
+	help
+	  Support for the HTC Sapphire.
+
 config MACH_MSM7X30_SURF
 	depends on ARCH_MSM7X30
 	bool "MSM7x30 SURF"
arch/arm/mach-msm/Makefile +1 -0
index 4ad3969..aff4e5c 100644
@@ -20,6 +20,7 @@ CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1)
 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
 obj-$(CONFIG_SMP) += headsmp.o platsmp.o
 
+obj-$(CONFIG_MACH_SAPPHIRE) += board-sapphire.o devices-msm7x00.o
 obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o devices-msm7x00.o
 obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o board-trout-panel.o devices-msm7x00.o
 obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o
arch/arm/mach-msm/board-sapphire.c +1 -17
index 4a8ea0d..e9e7969 100644
@@ -38,7 +38,6 @@
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
 
-#include "gpio_chip.h"
 #include "board-sapphire.h"
 #include "proc_comm.h"
 #include "devices.h"
@@ -48,7 +47,6 @@ void msm_init_gpio(void);
 
 static struct platform_device *devices[] __initdata = {
 	&msm_device_smd,
-	&msm_device_dmov,
 	&msm_device_nand,
 	&msm_device_uart1,
 	&msm_device_uart3,
@@ -78,27 +76,13 @@ static struct map_desc sapphire_io_desc[] __initdata = {
 static void __init sapphire_fixup(struct tag *tags, char **cmdline,
 				  struct meminfo *mi)
 {
-	int smi_sz = parse_tag_smi((const struct tag *)tags);
-
-	mi->nr_banks = 1;
-	mi->bank[0].start = PHYS_OFFSET;
-	mi->bank[0].node = PHYS_TO_NID(PHYS_OFFSET);
-	if (smi_sz == 32) {
-		mi->bank[0].size = (84*1024*1024);
-	} else if (smi_sz == 64) {
-		mi->bank[0].size = (101*1024*1024);
-	} else {
-		/* Give a default value when not get smi size */
-		smi_sz = 64;
-		mi->bank[0].size = (101*1024*1024);
-	}
 }
 
 static void __init sapphire_map_io(void)
 {
 	msm_map_common_io();
 	iotable_init(sapphire_io_desc, ARRAY_SIZE(sapphire_io_desc));
-	msm_clock_init();
+	msm_clock_init(msm_clocks_7x01a, msm_num_clocks_7x01a);
 }
 
 MACHINE_START(SAPPHIRE, "sapphire")
arch/arm/mach-msm/board-sapphire.h new file +224 -0

224 lines not on this page · raw message

Signature · 1 line
1.7.10.130.g36e6c
#1 lore raw

PATCH 2/2 arm: msm: halibut: remove unneeded fixup

This old fixup causes a build failure, so I remove it just like in trout.

---
 arch/arm/mach-msm/board-halibut.c |    3 ---
 1 file changed, 3 deletions(-)
arch/arm/mach-msm/board-halibut.c +0 -3
index 3698a37..26aac36 100644
@@ -86,9 +86,6 @@ static void __init halibut_init(void)
 static void __init halibut_fixup(struct tag *tags, char **cmdline,
 				 struct meminfo *mi)
 {
-	mi->nr_banks=1;
-	mi->bank[0].start = PHYS_OFFSET;
-	mi->bank[0].size = (101*1024*1024);
 }
 
 static void __init halibut_map_io(void)
Signature · 1 line
1.7.10.130.g36e6c
#2 lore raw
In reply to Daniel Walker

Hi,

Quoted 27 lines · Daniel Walker

Adds sapphire into the make file, and fixes all the code problems that prevented it from building (including adding board-sapphire.h)

---
 arch/arm/mach-msm/Kconfig          |   10 +- arch/arm/mach-msm/Makefile         |    1 + arch/arm/mach-msm/board-sapphire.c |   18 +-- arch/arm/mach-msm/board-sapphire.h |  224 ++++++++++++++++++++++++++++++++++++

 4 files changed, 235 insertions(+), 18 deletions(-)

 create mode 100644 arch/arm/mach-msm/board-sapphire.h

arch/arm/mach-msm/Kconfig +0 -0
index 1cd40ad..04f3b8e 100644
@@ -6,7 +6,6 @@ choice
 

 config ARCH_MSM7X00A
       bool "MSM7x00A / MSM7x01A"
-       select MACH_TROUT if !MACH_HALIBUT
       select ARCH_MSM_ARM11
       select MSM_SMD
       select MSM_SMD_PKG3

arch/arm/mach-msm/Kconfig +0 -0
@@ -80,6 +79,7 @@ config  MSM_VIC

 menu "Qualcomm MSM Board Type"

Quoted 2 lines

 config MACH_HALIBUT
+       select MACH_TROUT if !MACH_SAPPHIRE && !MACH_HALIBUT

This doesn't seem to make much sense here.

Quoted 9 lines

       depends on ARCH_MSM
       depends on ARCH_MSM7X00A
       bool "Halibut Board (QCT SURF7201A)"

arch/arm/mach-msm/Kconfig +0 -0
@@ -93,6 +93,14 @@ config MACH_TROUT

       help
         Support for the HTC Dream, T-Mobile G1, Android ADP1 devices.

+config MACH_SAPPHIRE
+       select MACH_TROUT if !MACH_HALIBUT && !MACH_SAPPHIRE

Nor does this.

I presume these are here to make sure that at least one of the boards is selected. There are already build checks to make sure that at least one machine entry exists, so if a user mis-configures his kernel he will hit a build error. Seems as reasonable as any catch for this.

If you feel strongly that you need to select at least one board, then do so at the ARCH_ level, not on every board option.

Thanks,

-Olof

#3 lore raw
Quoted 47 lines · Olof Johansson

Hi,

Quoted 27 lines · Daniel Walker

Adds sapphire into the make file, and fixes all the code problems that prevented it from building (including adding board-sapphire.h)

---
 arch/arm/mach-msm/Kconfig          |   10 +- arch/arm/mach-msm/Makefile         |    1 + arch/arm/mach-msm/board-sapphire.c |   18 +-- arch/arm/mach-msm/board-sapphire.h |  224 ++++++++++++++++++++++++++++++++++++

 4 files changed, 235 insertions(+), 18 deletions(-)

 create mode 100644 arch/arm/mach-msm/board-sapphire.h

arch/arm/mach-msm/Kconfig +0 -0
index 1cd40ad..04f3b8e 100644
@@ -6,7 +6,6 @@ choice
 

 config ARCH_MSM7X00A
       bool "MSM7x00A / MSM7x01A"
-       select MACH_TROUT if !MACH_HALIBUT
       select ARCH_MSM_ARM11
       select MSM_SMD
       select MSM_SMD_PKG3

arch/arm/mach-msm/Kconfig +0 -0
@@ -80,6 +79,7 @@ config  MSM_VIC

 menu "Qualcomm MSM Board Type"

Quoted 2 lines

 config MACH_HALIBUT
+       select MACH_TROUT if !MACH_SAPPHIRE && !MACH_HALIBUT

This doesn't seem to make much sense here.

Quoted 9 lines

       depends on ARCH_MSM
       depends on ARCH_MSM7X00A
       bool "Halibut Board (QCT SURF7201A)"

arch/arm/mach-msm/Kconfig +0 -0
@@ -93,6 +93,14 @@ config MACH_TROUT

       help
         Support for the HTC Dream, T-Mobile G1, Android ADP1 devices.

+config MACH_SAPPHIRE
+       select MACH_TROUT if !MACH_HALIBUT && !MACH_SAPPHIRE

Nor does this.

Quoted 7 lines

I presume these are here to make sure that at least one of the boards is selected. There are already build checks to make sure that at least one machine entry exists, so if a user mis-configures his kernel he will hit a build error. Seems as reasonable as any catch for this.

If you feel strongly that you need to select at least one board, then do so at the ARCH_ level, not on every board option.

I'll go ahead and leave this patch out of the msm-core tree for 3.5. Daniel, feel free to update the patch, and I can make another pull.

David

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#4 lore raw

PATCH v2 1/1 arm: msm: fix up very basic HTC Sapphire support

In reply to Olof Johansson

From: Daniel Walker <[email protected]>

Adds sapphire into the make file, and fixes all the code problems that prevented it from building (including adding board-sapphire.h)

[davidb at codeaurora.org: Move MACH_TROUT selection back under ARCH_MSM7X00A]

---
v2 - Moved MACH_TROUT selection back under the ARCH config target

 arch/arm/mach-msm/Kconfig          |    9 +-
 arch/arm/mach-msm/Makefile         |    1 +
 arch/arm/mach-msm/board-sapphire.c |   18 +--
 arch/arm/mach-msm/board-sapphire.h |  224 ++++++++++++++++++++++++++++++++++++
 4 files changed, 234 insertions(+), 18 deletions(-)
 create mode 100644 arch/arm/mach-msm/board-sapphire.h
arch/arm/mach-msm/Kconfig +8 -1
index 1cd40ad..70eae63 100644
@@ -6,7 +6,7 @@ choice
 
 config ARCH_MSM7X00A
 	bool "MSM7x00A / MSM7x01A"
-	select MACH_TROUT if !MACH_HALIBUT
+	select MACH_TROUT if (!MACH_HALIBUT && !MACH_SAPPHIRE)
 	select ARCH_MSM_ARM11
 	select MSM_SMD
 	select MSM_SMD_PKG3
@@ -93,6 +93,13 @@ config MACH_TROUT
 	help
 	  Support for the HTC Dream, T-Mobile G1, Android ADP1 devices.
 
+config MACH_SAPPHIRE
+	depends on ARCH_MSM
+	depends on ARCH_MSM7X00A
+	bool "HTC Sapphire"
+	help
+	  Support for the HTC Sapphire.
+
 config MACH_MSM7X30_SURF
 	depends on ARCH_MSM7X30
 	bool "MSM7x30 SURF"
arch/arm/mach-msm/Makefile +1 -0
index 4ad3969..aff4e5c 100644
@@ -20,6 +20,7 @@ CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1)
 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
 obj-$(CONFIG_SMP) += headsmp.o platsmp.o
 
+obj-$(CONFIG_MACH_SAPPHIRE) += board-sapphire.o devices-msm7x00.o
 obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o devices-msm7x00.o
 obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o board-trout-panel.o devices-msm7x00.o
 obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o
arch/arm/mach-msm/board-sapphire.c +1 -17
index 4a8ea0d..e9e7969 100644
@@ -38,7 +38,6 @@
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
 
-#include "gpio_chip.h"
 #include "board-sapphire.h"
 #include "proc_comm.h"
 #include "devices.h"
@@ -48,7 +47,6 @@ void msm_init_gpio(void);
 
 static struct platform_device *devices[] __initdata = {
 	&msm_device_smd,
-	&msm_device_dmov,
 	&msm_device_nand,
 	&msm_device_uart1,
 	&msm_device_uart3,
@@ -78,27 +76,13 @@ static struct map_desc sapphire_io_desc[] __initdata = {
 static void __init sapphire_fixup(struct tag *tags, char **cmdline,
 				  struct meminfo *mi)
 {
-	int smi_sz = parse_tag_smi((const struct tag *)tags);
-
-	mi->nr_banks = 1;
-	mi->bank[0].start = PHYS_OFFSET;
-	mi->bank[0].node = PHYS_TO_NID(PHYS_OFFSET);
-	if (smi_sz == 32) {
-		mi->bank[0].size = (84*1024*1024);
-	} else if (smi_sz == 64) {
-		mi->bank[0].size = (101*1024*1024);
-	} else {
-		/* Give a default value when not get smi size */
-		smi_sz = 64;
-		mi->bank[0].size = (101*1024*1024);
-	}
 }
 
 static void __init sapphire_map_io(void)
 {
 	msm_map_common_io();
 	iotable_init(sapphire_io_desc, ARRAY_SIZE(sapphire_io_desc));
-	msm_clock_init();
+	msm_clock_init(msm_clocks_7x01a, msm_num_clocks_7x01a);
 }
 
 MACHINE_START(SAPPHIRE, "sapphire")
arch/arm/mach-msm/board-sapphire.h new file +224 -0

224 lines not on this page · raw message

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#5 lore raw

Hi,

Sorry, I should have found the below items on the first review and not now on the second one, but see below.

Quoted 26 lines · David Brown

From: Daniel Walker <[email protected]>

Adds sapphire into the make file, and fixes all the code problems that prevented it from building (including adding board-sapphire.h)

[davidb at codeaurora.org: Move MACH_TROUT selection back under ARCH_MSM7X00A]

---
v2 - Moved MACH_TROUT selection back under the ARCH config target

?arch/arm/mach-msm/Kconfig ? ? ? ? ?| ? ?9 +-
?arch/arm/mach-msm/Makefile ? ? ? ? | ? ?1 +
?arch/arm/mach-msm/board-sapphire.c | ? 18 +--
?arch/arm/mach-msm/board-sapphire.h | ?224 ++++++++++++++++++++++++++++++++++++

?4 files changed, 234 insertions(+), 18 deletions(-) ?create mode 100644 arch/arm/mach-msm/board-sapphire.h

arch/arm/mach-msm/Kconfig +0 -0
index 1cd40ad..70eae63 100644
@@ -6,7 +6,7 @@ choice
 
Quoted 4 lines

?config ARCH_MSM7X00A
? ? ? ?bool "MSM7x00A / MSM7x01A"
- ? ? ? select MACH_TROUT if !MACH_HALIBUT
+ ? ? ? select MACH_TROUT if (!MACH_HALIBUT && !MACH_SAPPHIRE)

Better, thanks!

Quoted 8 lines
arch/arm/mach-msm/Makefile +0 -0
index 4ad3969..aff4e5c 100644
@@ -20,6 +20,7 @@ CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1)

?obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
?obj-$(CONFIG_SMP) += headsmp.o platsmp.o

Quoted 4 lines

+obj-$(CONFIG_MACH_SAPPHIRE) += board-sapphire.o devices-msm7x00.o
?obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o devices-msm7x00.o ?obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o board-trout-panel.o devices-msm7x00.o ?obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o

Unrelated to this change per se, but it seems like devices-msm7x00.o should be on an obj-$(CONFIG_ARCH_MSM7X00A) statement instead of duplicated for all boards.

Also, the trout line is mostly duplicated, only delta is panel. Looks broken. Both of these things is material for a separate patch though.

Quoted 6 lines
arch/arm/mach-msm/board-sapphire.h new file +0 -0
new file mode 100644
index 0000000..70f925e
@@ -0,0 +1,224 @@

[..]

arch/arm/mach-msm/board-sapphire.h line 222

Quoted 8 lines
arch/arm/mach-msm/board-sapphire.h new file +8 -0
+void config_sapphire_camera_on_gpios(void);
+void config_sapphire_camera_off_gpios(void);
+int sapphire_get_smi_size(void);
+unsigned int sapphire_get_hwid(void);
+unsigned int sapphire_get_skuid(void);
+unsigned int is_12pin_camera(void);
+int sapphire_is_5M_camera(void);
+int sapphire_gpio_write(struct gpio_chip *chip, unsigned n, unsigned on);

Many (all?) of these functions are not to be found in the code. Please don't add prototypes for code that isn't there.

-Olof

#6 lore raw
Quoted 2 lines · Olof Johansson

Sorry, I should have found the below items on the first review and not now on the second one, but see below.

Daniel, I don't mind fixing up minor things, but can you take care of the other issues that Olof has brought up.

Thanks,
David

Quoted 76 lines · David Brown
Quoted 26 lines

From: Daniel Walker <[email protected]>

Adds sapphire into the make file, and fixes all the code problems that prevented it from building (including adding board-sapphire.h)

[davidb at codeaurora.org: Move MACH_TROUT selection back under ARCH_MSM7X00A]

---
v2 - Moved MACH_TROUT selection back under the ARCH config target

?arch/arm/mach-msm/Kconfig ? ? ? ? ?| ? ?9 +-
?arch/arm/mach-msm/Makefile ? ? ? ? | ? ?1 +
?arch/arm/mach-msm/board-sapphire.c | ? 18 +--
?arch/arm/mach-msm/board-sapphire.h | ?224 ++++++++++++++++++++++++++++++++++++

?4 files changed, 234 insertions(+), 18 deletions(-) ?create mode 100644 arch/arm/mach-msm/board-sapphire.h

arch/arm/mach-msm/Kconfig +0 -0
index 1cd40ad..70eae63 100644
@@ -6,7 +6,7 @@ choice
 
Quoted 4 lines

?config ARCH_MSM7X00A
? ? ? ?bool "MSM7x00A / MSM7x01A"
- ? ? ? select MACH_TROUT if !MACH_HALIBUT
+ ? ? ? select MACH_TROUT if (!MACH_HALIBUT && !MACH_SAPPHIRE)

Better, thanks!

Quoted 8 lines
arch/arm/mach-msm/Makefile +0 -0
index 4ad3969..aff4e5c 100644
@@ -20,6 +20,7 @@ CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1)

?obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
?obj-$(CONFIG_SMP) += headsmp.o platsmp.o

Quoted 4 lines

+obj-$(CONFIG_MACH_SAPPHIRE) += board-sapphire.o devices-msm7x00.o
?obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o devices-msm7x00.o ?obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o board-trout-panel.o devices-msm7x00.o ?obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o

Unrelated to this change per se, but it seems like devices-msm7x00.o should be on an obj-$(CONFIG_ARCH_MSM7X00A) statement instead of duplicated for all boards.

Also, the trout line is mostly duplicated, only delta is panel. Looks broken. Both of these things is material for a separate patch though.

Quoted 6 lines
arch/arm/mach-msm/board-sapphire.h new file +0 -0
new file mode 100644
index 0000000..70f925e
@@ -0,0 +1,224 @@

[..]

arch/arm/mach-msm/board-sapphire.h line 222

Quoted 8 lines
arch/arm/mach-msm/board-sapphire.h new file +8 -0
+void config_sapphire_camera_on_gpios(void);
+void config_sapphire_camera_off_gpios(void);
+int sapphire_get_smi_size(void);
+unsigned int sapphire_get_hwid(void);
+unsigned int sapphire_get_skuid(void);
+unsigned int is_12pin_camera(void);
+int sapphire_is_5M_camera(void);
+int sapphire_gpio_write(struct gpio_chip *chip, unsigned n, unsigned on);

Many (all?) of these functions are not to be found in the code. Please don't add prototypes for code that isn't there.

-Olof

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.