summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/skov-imx6
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/boards/skov-imx6')
-rw-r--r--arch/arm/boards/skov-imx6/board.c192
-rw-r--r--arch/arm/boards/skov-imx6/lowlevel.c277
-rw-r--r--arch/arm/boards/skov-imx6/version.c6
3 files changed, 195 insertions, 280 deletions
diff --git a/arch/arm/boards/skov-imx6/board.c b/arch/arm/boards/skov-imx6/board.c
index bceb215a01..8ebb4a6e58 100644
--- a/arch/arm/boards/skov-imx6/board.c
+++ b/arch/arm/boards/skov-imx6/board.c
@@ -11,12 +11,18 @@
#include <gpio.h>
#include <init.h>
#include <linux/micrel_phy.h>
-#include <mach/bbu.h>
+#include <mach/imx/bbu.h>
#include <net.h>
#include <of_gpio.h>
#include "version.h"
+struct skov_imx6_priv {
+ struct device *dev;
+};
+
+static struct skov_imx6_priv *skov_priv;
+
static int eth_of_fixup_node(struct device_node *root, const char *node_path,
const u8 *ethaddr)
{
@@ -24,24 +30,21 @@ static int eth_of_fixup_node(struct device_node *root, const char *node_path,
int ret;
if (!is_valid_ether_addr(ethaddr)) {
- unsigned char ethaddr_str[sizeof("xx:xx:xx:xx:xx:xx")];
-
- ethaddr_to_string(ethaddr, ethaddr_str);
- pr_err("The mac-address %s is invalid.\n", ethaddr_str);
+ dev_err(skov_priv->dev, "The mac-address %pM is invalid.\n", ethaddr);
return -EINVAL;
}
node = of_find_node_by_path_from(root, node_path);
if (!node) {
- pr_err("Did not find node %s to fix up with stored mac-address.\n",
- node_path);
+ dev_err(skov_priv->dev, "Did not find node %s to fix up with stored mac-address.\n",
+ node_path);
return -ENOENT;
}
ret = of_set_property(node, "mac-address", ethaddr, ETH_ALEN, 1);
if (ret)
- pr_err("Setting mac-address property of %s failed with: %s.\n",
- node->full_name, strerror(-ret));
+ dev_err(skov_priv->dev, "Setting mac-address property of %pOF failed with: %s.\n",
+ node, strerror(-ret));
return ret;
}
@@ -54,7 +57,7 @@ static int eth_of_fixup_node_from_eth_device(struct device_node *root,
edev = eth_get_byname(ethname);
if (!edev) {
- pr_err("Did not find eth device \"%s\" to copy mac-address from.\n", ethname);
+ dev_err(skov_priv->dev, "Did not find eth device \"%s\" to copy mac-address from.\n", ethname);
return -ENOENT;
}
@@ -68,14 +71,14 @@ static int get_mac_address_from_env_variable(const char *env, u8 ethaddr[ETH_ALE
ethaddr_str = getenv(env);
if (!ethaddr_str) {
- pr_err("State variable %s storing the mac-address not found.\n", env);
+ dev_err(skov_priv->dev, "State variable %s storing the mac-address not found.\n", env);
return -ENOENT;
}
ret = string_to_ethaddr(ethaddr_str, ethaddr);
if (ret < 0) {
- pr_err("Could not convert \"%s\" in state variable %s into mac-address.\n",
- ethaddr_str, env);
+ dev_err(skov_priv->dev, "Could not convert \"%s\" in state variable %s into mac-address.\n",
+ ethaddr_str, env);
return -EINVAL;
}
@@ -90,13 +93,13 @@ static int get_default_mac_address_from_state_node(const char *state_node_path,
node = of_find_node_by_path(state_node_path);
if (!node) {
- pr_err("Node %s defining the state variable not found.\n", state_node_path);
+ dev_err(skov_priv->dev, "Node %s defining the state variable not found.\n", state_node_path);
return -ENOENT;
}
ret = of_property_read_u8_array(node, "default", ethaddr, ETH_ALEN);
if (ret) {
- pr_err("Node %s has no property \"default\" of proper type.\n", state_node_path);
+ dev_err(skov_priv->dev, "Node %s has no property \"default\" of proper type.\n", state_node_path);
return -ENOENT;
}
@@ -133,9 +136,6 @@ copy_mac_from_eth0:
return eth_of_fixup_node_from_eth_device(root, node_path, ethname);
}
-#define SKOV_GPIO_MDIO_BUS 0
-#define SKOV_LAN1_PHY_ADDR 1
-
#define MAX_V_GPIO 8
struct board_description {
@@ -343,18 +343,18 @@ static void skov_imx6_no_switch(struct device_node *root)
if (node) {
ret = of_device_disable(node);
if (ret)
- pr_warn("Can't disable %s\n", fec_alias);
+ dev_warn(skov_priv->dev, "Can't disable %s\n", fec_alias);
} else {
- pr_warn("Can't find node by alias: %s\n", fec_alias);
+ dev_warn(skov_priv->dev, "Can't find node by alias: %s\n", fec_alias);
}
node = of_find_node_by_alias(root, "mdio-gpio0");
if (node) {
ret = of_device_disable(node);
if (ret)
- pr_warn("Can't disable mdio-gpio0 node\n");
+ dev_warn(skov_priv->dev, "Can't disable mdio-gpio0 node\n");
} else {
- pr_warn("Can't find mdio-gpio0 node\n");
+ dev_warn(skov_priv->dev, "Can't find mdio-gpio0 node\n");
}
}
@@ -401,7 +401,7 @@ static void skov_imx6_switch(struct device_node *root)
if (ret) {
ret = skov_imx6_switch_port(root, old);
if (ret)
- pr_err("Filed to set mac address\n");
+ dev_err(skov_priv->dev, "Filed to set mac address\n");
}
}
@@ -426,7 +426,7 @@ static int skov_imx6_fixup(struct device_node *root, void *unused)
default:
val = getenv("state.display.brightness");
if (!val) {
- pr_err("could not get default display brightness\n");
+ dev_err(skov_priv->dev, "could not get default display brightness\n");
return 0;
}
@@ -437,7 +437,7 @@ static int skov_imx6_fixup(struct device_node *root, void *unused)
for_each_compatible_node_from(node, root, NULL, "pwm-backlight") {
ret = of_property_write_u32(node, "default-brightness-level", brightness);
if (ret)
- pr_err("error %d while setting default-brightness-level property on node %s to %d\n",
+ dev_err(skov_priv->dev, "error %d while setting default-brightness-level property on node %s to %d\n",
ret, node->name, brightness);
}
@@ -448,6 +448,40 @@ static int skov_imx6_fixup(struct device_node *root, void *unused)
return 0;
}
+static void skov_init_parallel_lcd(void)
+{
+ struct device_node *lcd;
+
+ lcd = of_find_compatible_node(NULL, NULL, "fsl,imx-parallel-display");
+ if (!lcd) {
+ dev_err(skov_priv->dev, "Cannot find \"fsl,imx-parallel-display\" node\n");
+ return;
+ }
+
+ of_device_enable_and_register(lcd);
+}
+
+static void skov_init_ldb(void)
+{
+ struct device_node *ldb, *chan;
+
+ ldb = of_find_compatible_node(NULL, NULL, "fsl,imx6q-ldb");
+ if (!ldb) {
+ dev_err(skov_priv->dev, "Cannot find \"fsl,imx6q-ldb\" node\n");
+ return;
+ }
+
+ /* First enable channel 0, prior to enabling parent */
+ chan = of_find_node_by_name_address(ldb, "lvds-channel@0");
+ if (chan)
+ of_device_enable(chan);
+ else
+ dev_err(skov_priv->dev, "Cannot find \"lvds-channel@0\" node\n");
+
+ /* Now probe will see the expected device tree */
+ of_device_enable_and_register(ldb);
+}
+
/*
* Some variants need tweaks to make them work
*
@@ -458,7 +492,6 @@ static int skov_imx6_fixup(struct device_node *root, void *unused)
static void skov_init_board(const struct board_description *variant)
{
struct device_node *gpio_np = NULL;
- struct device_node *np;
char *environment_path, *envdev;
int ret;
@@ -466,9 +499,9 @@ static void skov_init_board(const struct board_description *variant)
if (gpio_np) {
ret = of_device_ensure_probed(gpio_np);
if (ret)
- pr_warn("Can't probe GPIO node\n");
+ dev_warn(skov_priv->dev, "Can't probe GPIO node\n");
} else {
- pr_warn("Can't get GPIO node\n");
+ dev_warn(skov_priv->dev, "Can't get GPIO node\n");
}
imx6_bbu_internal_spi_i2c_register_handler("spiflash", "/dev/m25p0.barebox",
@@ -487,12 +520,12 @@ static void skov_init_board(const struct board_description *variant)
break;
}
- pr_notice("Using environment in %s\n", envdev);
+ dev_notice(skov_priv->dev, "Using environment in %s\n", envdev);
ret = of_device_enable_path(environment_path);
if (ret < 0)
- pr_warn("Failed to enable environment partition '%s' (%d)\n",
- environment_path, ret);
+ dev_warn(skov_priv->dev, "Failed to enable environment partition '%s' (%d)\n",
+ environment_path, ret);
if (variant->flags & SKOV_NEED_ENABLE_RMII) {
/*
@@ -501,11 +534,13 @@ static void skov_init_board(const struct board_description *variant)
*/
gpio_request(24, "must_be_low");
gpio_direction_output(24, 0);
+ gpio_free(24);
}
/* SD card handling */
gpio_request(205, "mmc io supply");
gpio_direction_output(205, 0); /* select 3.3 V IO voltage */
+ gpio_free(205);
if (variant->flags & SKOV_ENABLE_MMC_POWER) {
/*
@@ -516,78 +551,89 @@ static void skov_init_board(const struct board_description *variant)
gpio_direction_output(200, 0); /* switch on */
mdelay(1);
gpio_direction_output(200, 1); /* switch on */
+ gpio_free(200);
}
- if (variant->flags & SKOV_DISPLAY_PARALLEL) {
- np = of_find_compatible_node(NULL, NULL, "fsl,imx-parallel-display");
- if (np)
- of_device_enable_and_register(np);
- else
- pr_err("Cannot find \"fsl,imx-parallel-display\" node\n");
+ if (variant->flags & SKOV_DISPLAY_PARALLEL)
+ skov_init_parallel_lcd();
+
+ if (variant->flags & SKOV_DISPLAY_LVDS)
+ skov_init_ldb();
+}
+
+static int skov_set_switch_lan2_mac(struct skov_imx6_priv *priv)
+{
+ const char *state = "/state/ethaddr/eth2";
+ struct device_node *lan2_np;
+ u8 ethaddr[ETH_ALEN];
+ int ret;
+
+ ret = get_mac_address_from_env_variable("state.ethaddr.eth2", ethaddr);
+ if (ret || !is_valid_ether_addr(ethaddr)) {
+ ret = get_default_mac_address_from_state_node(state, ethaddr);
+ if (ret || !is_valid_ether_addr(ethaddr)) {
+ dev_err(priv->dev, "can't get MAC for LAN2\n");
+ return -ENODEV;
+ }
}
- if (variant->flags & SKOV_DISPLAY_LVDS) {
- np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-ldb");
- if (np)
- of_device_enable_and_register(np);
- else
- pr_err("Cannot find \"fsl,imx6q-ldb\" node\n");
-
- /* ... as well as its channel 0 */
- np = of_find_node_by_name_address(np, "lvds-channel@0");
- if (np)
- of_device_enable(np);
- else
- pr_err("Cannot find \"lvds-channel@0\" node\n");
+ lan2_np = of_find_node_by_path("/mdio/switch@0/ports/ports@1");
+ if (!lan2_np) {
+ dev_err(priv->dev, "LAN2 node not found\n");
+ return -ENODEV;
}
+
+ of_eth_register_ethaddr(lan2_np, ethaddr);
+
+ return 0;
}
static int skov_switch_test(void)
{
- struct phy_device *phydev;
- struct device_d *eth0;
- struct mii_bus *mii;
+ struct device *sw_dev;
+ struct device *eth0;
int ret;
if (skov_board_no < 0)
return 0;
- /* On this boards, we have only one MDIO bus. So, it is enough to take
- * the first one.
- */
- mii = mdiobus_get_bus(SKOV_GPIO_MDIO_BUS);
- /* We can't read the switch ID, but we get get ID of the first PHY,
- * which is enough to test if the switch is attached.
+ /* Driver should be able to detect if device do actually
+ * exist. So, we need only to detect if driver is actually
+ * probed.
*/
- phydev = get_phy_device(mii, SKOV_LAN1_PHY_ADDR);
- if (IS_ERR(phydev))
- goto no_switch;
-
- if (phydev->phy_id != PHY_ID_KSZ886X)
+ sw_dev = of_find_device_by_node_path("/mdio/switch@0");
+ if (!sw_dev) {
+ dev_err(skov_priv->dev, "switch@0 device was not created!\n");
goto no_switch;
+ }
- return 0;
+ if (dev_is_probed(sw_dev)) {
+ skov_set_switch_lan2_mac(skov_priv);
+ /* even if we fail, continue to boot as good as possible */
+ return 0;
+ }
no_switch:
skov_have_switch = false;
- pr_notice("No-switch variant is detected\n");
+ dev_notice(skov_priv->dev, "No-switch variant is detected\n");
eth0 = get_device_by_name("eth0");
if (eth0) {
ret = dev_set_param(eth0, "mode", "disabled");
if (ret)
- pr_warn("Can't set eth0 mode\n");
+ dev_warn(skov_priv->dev, "Can't set eth0 mode\n");
} else {
- pr_warn("Can't disable eth0\n");
+ dev_warn(skov_priv->dev, "Can't disable eth0\n");
}
return 0;
}
late_initcall(skov_switch_test);
-static int skov_imx6_probe(struct device_d *dev)
+static int skov_imx6_probe(struct device *dev)
{
+ struct skov_imx6_priv *priv;
unsigned v = 0;
const struct board_description *variant;
@@ -607,6 +653,10 @@ static int skov_imx6_probe(struct device_d *dev)
skov_board_no = v;
+ priv = xzalloc(sizeof(*priv));
+ priv->dev = dev;
+ skov_priv = priv;
+
globalvar_add_simple_int("board.no", &skov_board_no, "%u");
globalvar_add_simple("board.variant", variant->variant);
globalvar_add_simple("board.revision",variant->revision);
@@ -632,7 +682,7 @@ static __maybe_unused struct of_device_id skov_version_ids[] = {
};
BAREBOX_DEEP_PROBE_ENABLE(skov_version_ids);
-static struct driver_d skov_version_driver = {
+static struct driver skov_version_driver = {
.name = "skov-imx6",
.probe = skov_imx6_probe,
.of_compatible = DRV_OF_COMPAT(skov_version_ids),
@@ -648,7 +698,7 @@ static void skov_imx6_devices_shutdown(void)
external = getenv("state.display.external");
if (!external) {
- pr_err("could not get state variable display.external\n");
+ dev_err(skov_priv->dev, "could not get state variable display.external\n");
return;
}
diff --git a/arch/arm/boards/skov-imx6/lowlevel.c b/arch/arm/boards/skov-imx6/lowlevel.c
index ea6de36a36..16809dd4a6 100644
--- a/arch/arm/boards/skov-imx6/lowlevel.c
+++ b/arch/arm/boards/skov-imx6/lowlevel.c
@@ -3,19 +3,20 @@
#define pr_fmt(fmt) "skov-imx6: " fmt
#include <common.h>
-#include <mach/generic.h>
+#include <mach/imx/generic.h>
#include <asm/barebox-arm-head.h>
#include <asm/barebox-arm.h>
#include <debug_ll.h>
+#include <mach/imx/debug_ll.h>
#include <io.h>
-#include <mach/imx6-mmdc.h>
-#include <mach/imx6-ddr-regs.h>
-#include <mach/imx6.h>
-#include <mach/xload.h>
-#include <mach/esdctl.h>
+#include <mach/imx/imx6-mmdc.h>
+#include <mach/imx/imx6-ddr-regs.h>
+#include <mach/imx/imx6.h>
+#include <mach/imx/xload.h>
+#include <mach/imx/esdctl.h>
#include <serial/imx-uart.h>
-#include <mach/iomux-mx6.h>
-#include <mach/imx-gpio.h>
+#include <mach/imx/iomux-mx6.h>
+#include <mach/imx/imx-gpio.h>
#include "version.h"
static void __udelay(int us)
@@ -28,122 +29,6 @@ static void __udelay(int us)
/* ------------------------------------------------------------------------ */
/*
- * Micron MT41K512M16HA-125 IT:E -> 8 GBit = 64 Meg x 16 x 8 banks
- *
- * Speed Grade Data Rate (MT/s) tRCD-tRP-CL tRCD(ns) tRP(ns) CL(ns)
- * -125 1600 11-11-11 13.75 13.75 13.75
- * (=800 MHz)
- *
- * Memory configuration used by variant:
- * - "Max Performance", 64 bit data bus, 1066 MHz, 4 GiB memory
- */
-static const struct mx6_ddr3_cfg skov_imx6_cfg_4x512Mb_1066MHz = {
- .mem_speed = 1066,
- .density = 8, /* GiBit */
- .width = 16, /* 16 bit data per device */
- .banks = 8,
- .rowaddr = 16, /* 64 k */
- .coladdr = 10, /* 1 k */
- .pagesz = 2, /* [kiB] */
- .trcd = 1375, /* 13.75 ns = 11 clocks @ 1.6 GHz */
- .trcmin = 4875, /* 48.75 ns = 39 clocks @ 1.6 GHz */
- .trasmin = 3500, /* 35 ns = 28 clocks @ 1.6 GHz */
- .SRT = 0,
-};
-
-static const struct mx6_ddr_sysinfo skov_imx6_sysinfo_4x512Mb_1066MHz = {
- .dsize = 2, /* 64 bit wide = 4 devices, 16 bit each */
- .cs_density = 32, /* four 8 GBit devices connected */
- .ncs = 1, /* one CS line for all devices */
- .cs1_mirror = 1, /* TODO */
- .bi_on = 1, /* TODO */
- .rtt_nom = 1, /* MX6_MMDC_P0_MPODTCTRL -> 0x00022227 */
- .rtt_wr = 0, /* is LW_EN is 0 in their code */
- .ralat = 5, /* TODO */
- .walat = 1, /* TODO */
- .mif3_mode = 3, /* TODO */
- .rst_to_cke = 0x23, /* used in their code as well */
- .sde_to_rst = 0x10, /* used in their code as well */
- .pd_fast_exit = 0, /* TODO */
-};
-
-static const struct mx6_mmdc_calibration skov_imx6_calib_4x512Mb_1066MHz = {
- .p0_mpwldectrl0 = 0x001a0017,
- .p0_mpwldectrl1 = 0x001F001F,
- .p0_mpdgctrl0 = 0x43040319,
- .p0_mpdgctrl1 = 0x03040279,
- .p0_mprddlctl = 0x4d434248,
- .p0_mpwrdlctl = 0x34424543,
-
- .p1_mpwldectrl0 = 0x00170027,
- .p1_mpwldectrl1 = 0x000a001f,
- .p1_mpdgctrl0 = 0x43040321,
- .p1_mpdgctrl1 = 0x03030251,
- .p1_mprddlctl = 0x42413c4d,
- .p1_mpwrdlctl = 0x49324933,
-};
-
-/* ------------------------------------------------------------------------ */
-
-/*
- * Micron MT41K256M16HA-125 IT:E -> 4 GBit = 32 Meg x 16 x 8 banks
- *
- * Speed Grade Data Rate (MT/s) tRCD-tRP-CL tRCD(ns) tRP(ns) CL(ns)
- * -125 1600 11-11-11 13.75 13.75 13.75
- * (=800 MHz)
- *
- * Memory configuration used by variant:
- * - "Max Performance", 64 bit data bus, 1066 MHz, 2 GiB memory
- */
-static const struct mx6_ddr3_cfg skov_imx6_cfg_4x256Mb_1066MHz = {
- .mem_speed = 1066,
- .density = 4, /* GiBit */
- .width = 16, /* 16 bit data per device */
- .banks = 8,
- .rowaddr = 15, /* 32 k */
- .coladdr = 10, /* 1 k */
- .pagesz = 2, /* [kiB] */
- .trcd = 1375, /* 13.75 ns = 11 clocks @ 1.6 GHz */
- .trcmin = 4875, /* 48.75 ns = 39 clocks @ 1.6 GHz */
- .trasmin = 3500, /* 35 ns = 28 clocks @ 1.6 GHz */
- .SRT = 0,
-};
-
-static const struct mx6_ddr_sysinfo skov_imx6_sysinfo_4x256Mb_1066MHz = {
- .dsize = 2, /* 64 bit wide = 4 devices, 16 bit each */
- .cs_density = 16, /* four 4 GBit devices connected */
- .ncs = 1, /* one CS line for all devices */
- .cs1_mirror = 1, /* TODO */
- .bi_on = 1, /* TODO */
- .rtt_nom = 1, /* MX6_MMDC_P0_MPODTCTRL -> 0x00022227 */
- .rtt_wr = 0, /* is LW_EN is 0 in their code */
- .ralat = 5, /* TODO */
- .walat = 1, /* TODO */
- .mif3_mode = 3, /* TODO */
- .rst_to_cke = 0x23, /* used in their code as well */
- .sde_to_rst = 0x10, /* used in their code as well */
- .pd_fast_exit = 0, /* TODO */
-};
-
-static const struct mx6_mmdc_calibration skov_imx6_calib_4x256Mb_1066MHz = {
- .p0_mpwldectrl0 = 0x001a0017,
- .p0_mpwldectrl1 = 0x001F001F,
- .p0_mpdgctrl0 = 0x43040319,
- .p0_mpdgctrl1 = 0x03040279,
- .p0_mprddlctl = 0x4d434248,
- .p0_mpwrdlctl = 0x34424543,
-
- .p1_mpwldectrl0 = 0x00170027,
- .p1_mpwldectrl1 = 0x000a001f,
- .p1_mpdgctrl0 = 0x43040321,
- .p1_mpdgctrl1 = 0x03030251,
- .p1_mprddlctl = 0x42413c4d,
- .p1_mpwrdlctl = 0x49324933,
-};
-
-/* ------------------------------------------------------------------------ */
-
-/*
* Micron MT41K128M16JT-125 IT:K -> 2 GBit = 16 Meg x 16 x 8 banks
*
* Speed Grade Data Rate (MT/s) tRCD-tRP-CL tRCD(ns) tRP(ns) CL(ns)
@@ -174,33 +59,33 @@ static const struct mx6_ddr_sysinfo skov_imx6_sysinfo_4x128Mb_1066MHz = {
.dsize = 2, /* 64 bit wide = 4 devices, 16 bit each */
.cs_density = 8, /* four 2 GBit devices connected */
.ncs = 1, /* one CS line for all devices */
- .cs1_mirror = 1, /* TODO */
- .bi_on = 1, /* TODO */
+ .cs1_mirror = 1,
+ .bi_on = 1,
.rtt_nom = 1, /* MX6_MMDC_P0_MPODTCTRL -> 0x00022227 */
.rtt_wr = 0, /* is LW_EN is 0 in their code */
- .ralat = 5, /* TODO */
- .walat = 1, /* TODO */
- .mif3_mode = 3, /* TODO */
- .rst_to_cke = 0x23, /* used in their code as well */
- .sde_to_rst = 0x10, /* used in their code as well */
- .pd_fast_exit = 0, /* TODO */
+ .ralat = 5,
+ .walat = 0,
+ .mif3_mode = 3,
+ .rst_to_cke = 0x23,
+ .sde_to_rst = 0x10,
+ .pd_fast_exit = 1,
};
/* calibration info for the "max performance" and "high performance" */
static const struct mx6_mmdc_calibration skov_imx6_calib_4x128Mb_1066MHz = {
- .p0_mpwldectrl0 = 0x0011000E,
- .p0_mpwldectrl1 = 0x000E001B,
- .p0_mpdgctrl0 = 0x42720306,
- .p0_mpdgctrl1 = 0x026F0266,
- .p0_mprddlctl = 0x45393B3E,
- .p0_mpwrdlctl = 0x40434541,
-
- .p1_mpwldectrl0 = 0x00190015,
- .p1_mpwldectrl1 = 0x00070018,
- .p1_mpdgctrl0 = 0x4273030A,
- .p1_mpdgctrl1 = 0x02740240,
- .p1_mprddlctl = 0x403A3747,
- .p1_mpwrdlctl = 0x473E4A3B,
+ .p0_mpwldectrl0 = 0x00230023,
+ .p0_mpwldectrl1 = 0x0029001E,
+ .p0_mpdgctrl0 = 0x43400350,
+ .p0_mpdgctrl1 = 0x03380330,
+ .p0_mprddlctl = 0x3E323638,
+ .p0_mpwrdlctl = 0x383A3E3A,
+
+ .p1_mpwldectrl0 = 0x001F002A,
+ .p1_mpwldectrl1 = 0x001A0028,
+ .p1_mpdgctrl0 = 0x43300340,
+ .p1_mpdgctrl1 = 0x03340300,
+ .p1_mprddlctl = 0x383A3242,
+ .p1_mpwrdlctl = 0x4232463A,
};
/* ------------------------------------------------------------------------ */
@@ -214,21 +99,21 @@ static struct mx6dq_iomux_ddr_regs ddr_iomux_q = {
.dram_sdqs5 = 0x00000030,
.dram_sdqs6 = 0x00000030,
.dram_sdqs7 = 0x00000030,
- .dram_dqm0 = 0x00020030,
- .dram_dqm1 = 0x00020030,
- .dram_dqm2 = 0x00020030,
- .dram_dqm3 = 0x00020030,
- .dram_dqm4 = 0x00020030,
- .dram_dqm5 = 0x00020030,
- .dram_dqm6 = 0x00020030,
- .dram_dqm7 = 0x00020030,
- .dram_cas = 0x00020030,
- .dram_ras = 0x00020030,
- .dram_sdclk_0 = 0x00020030,
- .dram_sdclk_1 = 0x00020030,
+ .dram_dqm0 = 0x00000030,
+ .dram_dqm1 = 0x00000030,
+ .dram_dqm2 = 0x00000030,
+ .dram_dqm3 = 0x00000030,
+ .dram_dqm4 = 0x00000030,
+ .dram_dqm5 = 0x00000030,
+ .dram_dqm6 = 0x00000030,
+ .dram_dqm7 = 0x00000030,
+ .dram_cas = 0x00000030,
+ .dram_ras = 0x00000030,
+ .dram_sdclk_0 = 0x00000030,
+ .dram_sdclk_1 = 0x00000030,
.dram_sdcke0 = 0x00003000,
.dram_sdcke1 = 0x00003000,
- .dram_reset = 0x00020030,
+ .dram_reset = 0x00000030,
.dram_sdba2 = 0x00000000,
.dram_sdodt0 = 0x00003030,
.dram_sdodt1 = 0x00003030,
@@ -295,25 +180,25 @@ static const struct mx6_ddr_sysinfo skov_imx6_sysinfo_2x128Mb_800MHz = {
.dsize = 1, /* 32 bit wide = 2 devices, 16 bit each */
.cs_density = 4, /* two 2 GBit devices connected */
.ncs = 1, /* one CS line for all devices */
- .cs1_mirror = 1, /* TODO */
- .bi_on = 1, /* TODO */
+ .cs1_mirror = 1,
+ .bi_on = 1,
.rtt_nom = 1, /* MX6_MMDC_P0_MPODTCTRL -> 0x00022227 */
.rtt_wr = 0, /* is LW_EN is 0 in their code */
- .ralat = 5, /* TODO */
- .walat = 1, /* TODO */
- .mif3_mode = 3, /* TODO */
- .rst_to_cke = 0x23, /* used in their code as well */
- .sde_to_rst = 0x10, /* used in their code as well */
- .pd_fast_exit = 0, /* TODO */
+ .ralat = 5,
+ .walat = 0,
+ .mif3_mode = 3,
+ .rst_to_cke = 0x23,
+ .sde_to_rst = 0x10,
+ .pd_fast_exit = 1,
};
static const struct mx6_mmdc_calibration skov_imx6_calib_2x128Mb_800MHz = {
- .p0_mpwldectrl0 = 0x0040003C,
- .p0_mpwldectrl1 = 0x0032003E,
- .p0_mpdgctrl0 = 0x42350231,
- .p0_mpdgctrl1 = 0x021A0218,
- .p0_mprddlctl = 0x4B4B4E49,
- .p0_mpwrdlctl = 0x3F3F3035,
+ .p0_mpwldectrl0 = 0x004A004B,
+ .p0_mpwldectrl1 = 0x00420046,
+ .p0_mpdgctrl0 = 0x42400240,
+ .p0_mpdgctrl1 = 0x02300230,
+ .p0_mprddlctl = 0x464A4A4A,
+ .p0_mpwrdlctl = 0x32342A32,
};
/* ------------------------------------------------------------------------ */
@@ -327,21 +212,21 @@ static const struct mx6sdl_iomux_ddr_regs ddr_iomux_s = {
.dram_sdqs5 = 0x00000030,
.dram_sdqs6 = 0x00000030,
.dram_sdqs7 = 0x00000030,
- .dram_dqm0 = 0x00020030,
- .dram_dqm1 = 0x00020030,
- .dram_dqm2 = 0x00020030,
- .dram_dqm3 = 0x00020030,
- .dram_dqm4 = 0x00020030,
- .dram_dqm5 = 0x00020030,
- .dram_dqm6 = 0x00020030,
- .dram_dqm7 = 0x00020030,
- .dram_cas = 0x00020030,
- .dram_ras = 0x00020030,
- .dram_sdclk_0 = 0x00020030,
- .dram_sdclk_1 = 0x00020030,
+ .dram_dqm0 = 0x00000030,
+ .dram_dqm1 = 0x00000030,
+ .dram_dqm2 = 0x00000030,
+ .dram_dqm3 = 0x00000030,
+ .dram_dqm4 = 0x00000030,
+ .dram_dqm5 = 0x00000030,
+ .dram_dqm6 = 0x00000030,
+ .dram_dqm7 = 0x00000030,
+ .dram_cas = 0x00000030,
+ .dram_ras = 0x00000030,
+ .dram_sdclk_0 = 0x00000030,
+ .dram_sdclk_1 = 0x0000030,
.dram_sdcke0 = 0x00003000,
.dram_sdcke1 = 0x00003000,
- .dram_reset = 0x00020030,
+ .dram_reset = 0x00000030,
.dram_sdba2 = 0x00000000,
.dram_sdodt0 = 0x00003030,
.dram_sdodt1 = 0x00003030,
@@ -529,26 +414,6 @@ static void skov_imx6_init(int cpu_type, unsigned board_variant)
int instance;
switch (board_variant) {
- case 12: /* P2 i.MX6Q, max performance */
- if (cpu_type != IMX6_CPUTYPE_IMX6Q) {
- pr_err("Invalid SoC! i.MX6Q expected\n");
- return;
- }
- pr_debug("Initializing a P2 max performance system...\n");
- spl_imx6q_dram_init(&skov_imx6_sysinfo_4x256Mb_1066MHz,
- &skov_imx6_calib_4x256Mb_1066MHz,
- &skov_imx6_cfg_4x256Mb_1066MHz);
- break;
- case 18: /* i.MX6Q+ */
- if (cpu_type != IMX6_CPUTYPE_IMX6Q) {
- pr_err("Invalid SoC! i.MX6Q expected\n");
- return;
- }
- pr_debug("Initializing board variant 18\n");
- spl_imx6q_dram_init(&skov_imx6_sysinfo_4x512Mb_1066MHz,
- &skov_imx6_calib_4x512Mb_1066MHz,
- &skov_imx6_cfg_4x512Mb_1066MHz);
- break;
case 19: /* i.MX6S "Solo_R512M_F2G" */
if (cpu_type != IMX6_CPUTYPE_IMX6S) {
pr_err("Invalid SoC! i.MX6S expected\n");
@@ -658,7 +523,7 @@ static noinline void skov_imx6_start(void)
ENTRY_FUNCTION(start_imx6_skov_imx6, r0, r1, r2)
{
- arm_cpu_lowlevel_init();
+ imx6_cpu_lowlevel_init();
relocate_to_current_adr();
setup_c();
diff --git a/arch/arm/boards/skov-imx6/version.c b/arch/arm/boards/skov-imx6/version.c
index 5a6a0625ca..503a60366f 100644
--- a/arch/arm/boards/skov-imx6/version.c
+++ b/arch/arm/boards/skov-imx6/version.c
@@ -3,9 +3,9 @@
#define pr_fmt(fmt) "skov-imx6: " fmt
#include <common.h>
-#include <mach/iomux-mx6.h>
-#include <mach/imx-gpio.h>
-#include <mach/imx6.h>
+#include <mach/imx/iomux-mx6.h>
+#include <mach/imx/imx-gpio.h>
+#include <mach/imx/imx6.h>
#include "version.h"