Skip to content

Commit

Permalink
ARM: tegra: remove board (but not DT) support for Harmony
Browse files Browse the repository at this point in the history
Harmony can be booted using device tree with equal functionality as when
booted using a board file. Remove as much of the board file as is
possible, since it's no longer needed.

Two special-cases are still left in board-dt-tegra20.c, since the Tegra
PCIe driver doesn't support device tree yet, and the Harmony .dts file
doesn't yet describe regulators which are needed for PCIe. This logic is
now enabled unconditionally rather than via CONFIG_MACH_HARMONY. While
this is more code than other boards, it's still unlikely to be much of a
problem, and both regulators and PCIe should be supported via device tree
in the near future, allowing the remaining code to be removed.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
  • Loading branch information
Stephen Warren committed Sep 14, 2012
1 parent cff1dfb commit bb25af8
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 399 deletions.
6 changes: 0 additions & 6 deletions arch/arm/mach-tegra/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ config TEGRA_AHB

comment "Tegra board type"

config MACH_HARMONY
bool "Harmony board"
depends on ARCH_TEGRA_2x_SOC
help
Support for nVidia Harmony development platform

choice
prompt "Default low-level debug console UART"
default TEGRA_DEBUG_UART_NONE
Expand Down
6 changes: 2 additions & 4 deletions arch/arm/mach-tegra/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ obj-$(CONFIG_USB_SUPPORT) += usb_phy.o
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o

obj-$(CONFIG_MACH_HARMONY) += board-harmony.o
obj-$(CONFIG_MACH_HARMONY) += board-harmony-pinmux.o
obj-$(CONFIG_MACH_HARMONY) += board-harmony-pcie.o
obj-$(CONFIG_MACH_HARMONY) += board-harmony-power.o
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-harmony-pcie.o
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-harmony-power.o

obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-paz00.o
6 changes: 2 additions & 4 deletions arch/arm/mach-tegra/board-dt-tegra20.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ static void __init trimslice_init(void)
#endif
}

#ifdef CONFIG_MACH_HARMONY
static void __init harmony_init(void)
{
int ret;
Expand All @@ -117,11 +116,12 @@ static void __init harmony_init(void)
return;
}

#ifdef CONFIG_TEGRA_PCI
ret = harmony_pcie_init();
if (ret)
pr_err("harmony_pcie_init() failed: %d\n", ret);
}
#endif
}

static void __init paz00_init(void)
{
Expand All @@ -133,9 +133,7 @@ static struct {
void (*init)(void);
} board_init_funcs[] = {
{ "compulab,trimslice", trimslice_init },
#ifdef CONFIG_MACH_HARMONY
{ "nvidia,harmony", harmony_init },
#endif
{ "compal,paz00", paz00_init },
};

Expand Down
156 changes: 0 additions & 156 deletions arch/arm/mach-tegra/board-harmony-pinmux.c

This file was deleted.

34 changes: 15 additions & 19 deletions arch/arm/mach-tegra/board-harmony-power.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,29 +128,25 @@ static struct i2c_board_info __initdata harmony_regulators[] = {

int __init harmony_regulator_init(void)
{
struct device_node *np;
struct i2c_adapter *adapter;

regulator_register_always_on(0, "vdd_5v0",
NULL, 0, 5000000);

if (machine_is_harmony()) {
i2c_register_board_info(3, harmony_regulators, 1);
} else { /* Harmony, booted using device tree */
struct device_node *np;
struct i2c_adapter *adapter;

np = of_find_node_by_path("/i2c@7000d000");
if (np == NULL) {
pr_err("Could not find device_node for DVC I2C\n");
return -ENODEV;
}

adapter = of_find_i2c_adapter_by_node(np);
if (!adapter) {
pr_err("Could not find i2c_adapter for DVC I2C\n");
return -ENODEV;
}

i2c_new_device(adapter, harmony_regulators);
np = of_find_node_by_path("/i2c@7000d000");
if (np == NULL) {
pr_err("Could not find device_node for DVC I2C\n");
return -ENODEV;
}

adapter = of_find_i2c_adapter_by_node(np);
if (!adapter) {
pr_err("Could not find i2c_adapter for DVC I2C\n");
return -ENODEV;
}

i2c_new_device(adapter, harmony_regulators);

return 0;
}
Loading

0 comments on commit bb25af8

Please sign in to comment.