From cc67f4a63ff3c6ed0b8fab35ce4af6e683296e47 Mon Sep 17 00:00:00 2001 From: Nikita Kiryanov Date: Wed, 14 Jan 2015 10:42:42 +0200 Subject: arm: mx6: cm-fx6: change dtb node for ethaddr When passing eth address to Linux via dtb, the "local-mac-address" property should be set for "/soc/aips-bus@02100000/ethernet@02188000", not "/fec". Signed-off-by: Nikita Kiryanov Cc: Stefano Babic Cc: Igor Grinberg Acked-by: Igor Grinberg --- board/compulab/cm_fx6/cm_fx6.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'board/compulab/cm_fx6') diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 84e3643..5ddf8c6 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -464,8 +464,9 @@ int ft_board_setup(void *blob, bd_t *bd) /* MAC addr */ if (eth_getenv_enetaddr("ethaddr", enetaddr)) { - fdt_find_and_setprop(blob, "/fec", "local-mac-address", - enetaddr, 6, 1); + fdt_find_and_setprop(blob, + "/soc/aips-bus@02100000/ethernet@02188000", + "local-mac-address", enetaddr, 6, 1); } return 0; -- cgit v1.1 From e7a2447ba2d8483b7d029e77c59b0ee26eeabe88 Mon Sep 17 00:00:00 2001 From: Nikita Kiryanov Date: Wed, 14 Jan 2015 10:42:43 +0200 Subject: compulab: eeprom: allow reading mac address from multiple eeproms Implement the option to select the eeprom i2c bus when reading mac address. Signed-off-by: Nikita Kiryanov Cc: Stefano Babic Cc: Igor Grinberg Cc: Ilya Ledvich Cc: Dmitry Lifshitz Acked-by: Igor Grinberg --- board/compulab/cm_fx6/cm_fx6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board/compulab/cm_fx6') diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 5ddf8c6..32f4434 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -354,7 +354,7 @@ static int handle_mac_address(void) if (rc) return 0; - rc = cl_eeprom_read_mac_addr(enetaddr); + rc = cl_eeprom_read_mac_addr(enetaddr, CONFIG_SYS_I2C_EEPROM_BUS); if (rc) return rc; -- cgit v1.1 From eab29802d6211aeb9cd521a51d22a43c8fb4f94d Mon Sep 17 00:00:00 2001 From: Nikita Kiryanov Date: Wed, 14 Jan 2015 10:42:44 +0200 Subject: arm: mx6: cm-fx6: pass 2nd nic mac addr to Linux Obtain 2nd NIC MAC address from baseboard EEPROM and pass it to Linux. Signed-off-by: Nikita Kiryanov Cc: Stefano Babic Cc: Igor Grinberg Acked-by: Igor Grinberg --- board/compulab/cm_fx6/cm_fx6.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'board/compulab/cm_fx6') diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 32f4434..eb18dfc 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -345,32 +345,36 @@ static iomux_v3_cfg_t const enet_pads[] = { MUX_PAD_CTRL(ENET_PAD_CTRL)), }; -static int handle_mac_address(void) +static int handle_mac_address(char *env_var, uint eeprom_bus) { unsigned char enetaddr[6]; int rc; - rc = eth_getenv_enetaddr("ethaddr", enetaddr); + rc = eth_getenv_enetaddr(env_var, enetaddr); if (rc) return 0; - rc = cl_eeprom_read_mac_addr(enetaddr, CONFIG_SYS_I2C_EEPROM_BUS); + rc = cl_eeprom_read_mac_addr(enetaddr, eeprom_bus); if (rc) return rc; if (!is_valid_ether_addr(enetaddr)) return -1; - return eth_setenv_enetaddr("ethaddr", enetaddr); + return eth_setenv_enetaddr(env_var, enetaddr); } +#define SB_FX6_I2C_EEPROM_BUS 0 +#define NO_MAC_ADDR "No MAC address found for %s\n" int board_eth_init(bd_t *bis) { int err; - err = handle_mac_address(); - if (err) - puts("No MAC address found\n"); + if (handle_mac_address("ethaddr", CONFIG_SYS_I2C_EEPROM_BUS)) + printf(NO_MAC_ADDR, "primary NIC"); + + if (handle_mac_address("eth1addr", SB_FX6_I2C_EEPROM_BUS)) + printf(NO_MAC_ADDR, "secondary NIC"); SETUP_IOMUX_PADS(enet_pads); /* phy reset */ @@ -469,6 +473,11 @@ int ft_board_setup(void *blob, bd_t *bd) "local-mac-address", enetaddr, 6, 1); } + if (eth_getenv_enetaddr("eth1addr", enetaddr)) { + fdt_find_and_setprop(blob, "/eth@pcie", "local-mac-address", + enetaddr, 6, 1); + } + return 0; } #endif -- cgit v1.1 From deb94d6192e7507d743aefa69a86954c0c26be82 Mon Sep 17 00:00:00 2001 From: Nikita Kiryanov Date: Wed, 14 Jan 2015 10:42:46 +0200 Subject: arm: mx6: cm-fx6: add hdmi console support Add support for hdmi console. Signed-off-by: Nikita Kiryanov Cc: Stefano Babic Cc: Igor Grinberg Acked-by: Igor Grinberg --- board/compulab/cm_fx6/cm_fx6.c | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'board/compulab/cm_fx6') diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index eb18dfc..b31e1f5 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -18,8 +18,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -28,6 +30,53 @@ DECLARE_GLOBAL_DATA_PTR; +#ifdef CONFIG_IMX_HDMI +static void cm_fx6_enable_hdmi(struct display_info_t const *dev) +{ + imx_enable_hdmi_phy(); +} + +struct display_info_t const displays[] = { + { + .bus = -1, + .addr = 0, + .pixfmt = IPU_PIX_FMT_RGB24, + .detect = detect_hdmi, + .enable = cm_fx6_enable_hdmi, + .mode = { + .name = "HDMI", + .refresh = 60, + .xres = 1024, + .yres = 768, + .pixclock = 40385, + .left_margin = 220, + .right_margin = 40, + .upper_margin = 21, + .lower_margin = 7, + .hsync_len = 60, + .vsync_len = 10, + .sync = FB_SYNC_EXT, + .vmode = FB_VMODE_NONINTERLACED, + } + }, +}; +size_t display_count = ARRAY_SIZE(displays); + +static void cm_fx6_setup_display(void) +{ + struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; + int reg; + + enable_ipu_clock(); + imx_setup_hdmi(); + reg = __raw_readl(&mxc_ccm->CCGR3); + reg |= MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK; + writel(reg, &mxc_ccm->CCGR3); +} +#else +static inline void cm_fx6_setup_display(void) {} +#endif /* CONFIG_VIDEO_IPUV3 */ + #ifdef CONFIG_DWC_AHSATA static int cm_fx6_issd_gpios[] = { /* The order of the GPIOs in the array is important! */ @@ -516,6 +565,8 @@ int board_init(void) if (ret) printf("Warning: I2C setup failed: %d\n", ret); + cm_fx6_setup_display(); + return 0; } -- cgit v1.1 From 3a236a356397449bf3ad1e72221053b5a3d87b80 Mon Sep 17 00:00:00 2001 From: Nikita Kiryanov Date: Wed, 14 Jan 2015 10:42:53 +0200 Subject: arm: mx6: cm-fx6: add splash screen support Add support for splash screen. The splash screen is loaded from the SPI flash and is displayed on the HDMI display. Signed-off-by: Nikita Kiryanov [grinberg@compulab.co.il: minor code and commit message updates] Signed-off-by: Igor Grinberg Cc: Stefano Babic Cc: Igor Grinberg --- board/compulab/cm_fx6/cm_fx6.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'board/compulab/cm_fx6') diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index b31e1f5..b5c3ea1 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -27,9 +27,26 @@ #include #include "common.h" #include "../common/eeprom.h" +#include "../common/common.h" DECLARE_GLOBAL_DATA_PTR; +#ifdef CONFIG_SPLASH_SCREEN +static struct splash_location cm_fx6_splash_locations[] = { + { + .name = "sf", + .storage = SPLASH_STORAGE_SF, + .offset = 0x100000, + }, +}; + +int splash_screen_prepare(void) +{ + return cl_splash_screen_prepare(cm_fx6_splash_locations, + ARRAY_SIZE(cm_fx6_splash_locations)); +} +#endif + #ifdef CONFIG_IMX_HDMI static void cm_fx6_enable_hdmi(struct display_info_t const *dev) { -- cgit v1.1 From f82eb2fa5df86b7180ea355a3cb98482f7c27269 Mon Sep 17 00:00:00 2001 From: Nikita Kiryanov Date: Wed, 14 Jan 2015 10:42:54 +0200 Subject: common: convert compulab splash load code to common code Move board/compulab/common/splash.c code to common/splash_source.c to make it available for everybody. This move renames cl_splash_screen_prepare() to splash_source_load(), and the compilation of this code is conditional on CONFIG_SPLASH_SOURCE. splash_source features: * Provide a standardized way for declaring board specific splash screen locations * Provide existing routines for auto loading the splash image from the locations as declared by the board * Introduce the "splashsource" environment variable, which makes it possible to select the splash image source. cm-t35 and cm-fx6 are updated to use the modified version. Signed-off-by: Nikita Kiryanov Cc: Stefano Babic Cc: Tom Rini Cc: Igor Grinberg Cc: Anatolij Gustschin Reviewed-by: Tom Rini Acked-by: Igor Grinberg --- board/compulab/cm_fx6/cm_fx6.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'board/compulab/cm_fx6') diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index b5c3ea1..ae6945b 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -42,8 +43,8 @@ static struct splash_location cm_fx6_splash_locations[] = { int splash_screen_prepare(void) { - return cl_splash_screen_prepare(cm_fx6_splash_locations, - ARRAY_SIZE(cm_fx6_splash_locations)); + return splash_source_load(cm_fx6_splash_locations, + ARRAY_SIZE(cm_fx6_splash_locations)); } #endif -- cgit v1.1