obj-${CONFIG_MACH_ARDBEG} += board-ardbeg.o
obj-${CONFIG_MACH_ARDBEG} += board-ardbeg-kbc.o
obj-${CONFIG_MACH_ARDBEG} += board-ardbeg-sdhci.o
+obj-${CONFIG_MACH_ARDBEG} += board-ardbeg-sata.o
obj-${CONFIG_MACH_ARDBEG} += board-ardbeg-sensors.o
obj-${CONFIG_MACH_ARDBEG} += board-ardbeg-panel.o
obj-${CONFIG_MACH_ARDBEG} += board-ardbeg-memory.o
obj-${CONFIG_MACH_LAGUNA} += board-ardbeg.o
obj-${CONFIG_MACH_LAGUNA} += board-ardbeg-kbc.o
obj-${CONFIG_MACH_LAGUNA} += board-ardbeg-sdhci.o
+obj-${CONFIG_MACH_LAGUNA} += board-ardbeg-sata.o
obj-${CONFIG_MACH_LAGUNA} += board-ardbeg-sensors.o
obj-${CONFIG_MACH_LAGUNA} += board-ardbeg-panel.o
obj-${CONFIG_MACH_LAGUNA} += board-laguna-pinmux.o
--- /dev/null
+/*
+ *
+ * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/platform_data/tegra_ahci.h>
+
+#include "board.h"
+#include "board-ardbeg.h"
+#include "devices.h"
+#include "iomap.h"
+#include "tegra-board-id.h"
+
+#define CLK_RST_CNTRL_RST_DEV_W_SET 0x7000E438
+#define CLK_RST_CNTRL_RST_DEV_V_SET 0x7000E430
+#define SET_CEC_RST 0x100
+
+#ifdef CONFIG_SATA_AHCI_TEGRA
+static struct tegra_ahci_platform_data tegra_ahci_platform_data0 = {
+ .gen2_rx_eq = -1,
+ .pexp_gpio = PMU_TCA6416_GPIO(9),
+};
+#endif
+
+int __init ardbeg_sata_init(void)
+{
+ u32 val;
+#ifdef CONFIG_SATA_AHCI_TEGRA
+ struct board_info board_info;
+#endif
+ val = readl(IO_ADDRESS(CLK_RST_CNTRL_RST_DEV_W_SET));
+ if (val & SET_CEC_RST)
+ writel(0x108, IO_ADDRESS(CLK_RST_CNTRL_RST_DEV_V_SET));
+ val = readl(IO_ADDRESS(CLK_RST_CNTRL_RST_DEV_W_SET));
+ while (val & SET_CEC_RST)
+ val = readl(IO_ADDRESS(CLK_RST_CNTRL_RST_DEV_W_SET));
+#ifdef CONFIG_SATA_AHCI_TEGRA
+ tegra_get_board_info(&board_info);
+ if (board_info.board_id != BOARD_PM358)
+ tegra_ahci_platform_data0.pexp_gpio = -1;
+
+ tegra_sata_device.dev.platform_data = &tegra_ahci_platform_data0;
+ platform_device_register(&tegra_sata_device);
+#endif
+ return 0;
+}
.num_resources = ARRAY_SIZE(tegra_rtc_resources),
};
-#ifdef CONFIG_SATA_AHCI_TEGRA
-static struct tegra_ahci_platform_data tegra_ahci_platform_data0 = {
- .gen2_rx_eq = -1,
- .pexp_gpio = PMU_TCA6416_GPIO(9),
-};
-
-static void ardbeg_sata_init(void)
-{
- struct board_info board_info;
-
- tegra_get_board_info(&board_info);
- if (board_info.board_id == BOARD_PM363)
- tegra_ahci_platform_data0.pexp_gpio = -1;
-
- tegra_sata_device.dev.platform_data = &tegra_ahci_platform_data0;
- platform_device_register(&tegra_sata_device);
-}
-#else
-static void ardbeg_sata_init(void) { }
-#endif
-
static struct tegra_pci_platform_data laguna_pcie_platform_data = {
.port_status[0] = 1,
.port_status[1] = 1,
//tegra_ram_console_debug_init();
tegra_io_dpd_init();
ardbeg_sdhci_init();
+ ardbeg_sata_init();
if (board_info.board_id == BOARD_PM359 ||
board_info.board_id == BOARD_PM358 ||
board_info.board_id == BOARD_PM363)