[PATCH] arm: baltos: switch to CONFIG_DM_I2C

2023-05-15 Thread yegorslists
From: Yegor Yefremov 

Also use the TPS65910 driver directly.

Signed-off-by: Yegor Yefremov 
---
 board/vscom/baltos/board.c  | 44 ++---
 configs/am335x_baltos_defconfig |  8 +++---
 2 files changed, 23 insertions(+), 29 deletions(-)

diff --git a/board/vscom/baltos/board.c b/board/vscom/baltos/board.c
index f335d5b4f4..8f23cda8e4 100644
--- a/board/vscom/baltos/board.c
+++ b/board/vscom/baltos/board.c
@@ -76,17 +76,23 @@ static int baltos_set_console(void)
 
 static int read_eeprom(BSP_VS_HWPARAM *header)
 {
-   i2c_set_bus_num(1);
+   int rc;
+   struct udevice *dev;
+   struct udevice *bus;
+
+   rc = uclass_get_device_by_seq(UCLASS_I2C, 1, );
+   if (rc)
+   return rc;
 
/* Check if baseboard eeprom is available */
-   if (i2c_probe(CONFIG_SYS_I2C_EEPROM_ADDR)) {
+   if (dm_i2c_probe(bus, CONFIG_SYS_I2C_EEPROM_ADDR, 0, )) {
puts("Could not probe the EEPROM; something fundamentally "
"wrong on the I2C bus.\n");
return -ENODEV;
}
 
/* read the eeprom using i2c */
-   if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, 1, (uchar *)header,
+   if (dm_i2c_read(dev, 0, (uchar *)header,
 sizeof(BSP_VS_HWPARAM))) {
puts("Could not read the EEPROM; something fundamentally"
" wrong on the I2C bus.\n");
@@ -173,34 +179,28 @@ const struct dpll_params dpll_ddr_baltos = {
 
 void am33xx_spl_board_init(void)
 {
-   int mpu_vdd;
-   int sil_rev;
+   int sil_rev, mpu_vdd;
+   int freq;
+
+   enable_i2c1_pin_mux();
+   i2c_set_bus_num(1);
 
-   /* Get the frequency */
-   dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);
+   freq = am335x_get_efuse_mpu_max_freq(cdev);
 
/*
-* The GP EVM, IDK and EVM SK use a TPS65910 PMIC.  For all
+* The GP EVM, IDK and EVM SK use a TPS65910 PMIC. For all
 * MPU frequencies we support we use a CORE voltage of
-* 1.1375V.  For MPU voltage we need to switch based on
+* 1.1375V. For MPU voltage we need to switch based on
 * the frequency we are running at.
 */
-   i2c_set_bus_num(1);
-
-   printf("I2C speed: %d Hz\n", CONFIG_SYS_I2C_SPEED);
-
-   if (i2c_probe(TPS65910_CTRL_I2C_ADDR)) {
-   puts("i2c: cannot access TPS65910\n");
+   if (power_tps65910_init(1))
return;
-   }
-
/*
 * Depending on MPU clock and PG we will need a different
 * VDD to drive at that speed.
 */
sil_rev = readl(>deviceid) >> 28;
-   mpu_vdd = am335x_get_tps65910_mpu_vdd(sil_rev,
- dpll_mpu_opp100.m);
+   mpu_vdd = am335x_get_tps65910_mpu_vdd(sil_rev, freq);
 
/* Tell the TPS65910 to use i2c */
tps65910_set_i2c_control();
@@ -213,12 +213,6 @@ void am33xx_spl_board_init(void)
if (tps65910_voltage_update(CORE, TPS65910_OP_REG_SEL_1_1_3))
return;
 
-   /* Set CORE Frequencies to OPP100 */
-   do_setup_dpll(_core_regs, _core_opp100);
-
-   /* Set MPU Frequency to what we detected now that voltages are set */
-   do_setup_dpll(_mpu_regs, _mpu_opp100);
-
writel(0x10ff, PRM_DEVICE_INST + 4);
 }
 
diff --git a/configs/am335x_baltos_defconfig b/configs/am335x_baltos_defconfig
index 090b902be3..6ef3c78390 100644
--- a/configs/am335x_baltos_defconfig
+++ b/configs/am335x_baltos_defconfig
@@ -18,7 +18,6 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run findfdt; run usbboot;run mmcboot;setenv mmcdev 1; 
setenv bootpart 1:2; run mmcboot;run nandboot;"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
-CONFIG_ARCH_MISC_INIT=y
 CONFIG_SYS_SPL_MALLOC=y
 CONFIG_SYS_SPL_MALLOC_SIZE=0x80
 CONFIG_SPL_FS_EXT4=y
@@ -57,10 +56,10 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_NET_RETRY_COUNT=10
 CONFIG_BOOTP_SEND_HOSTNAME=y
+# CONFIG_TI_SYSC is not set
 CONFIG_BOOTCOUNT_LIMIT=y
-CONFIG_SYS_I2C_LEGACY=y
+CONFIG_DM_I2C=y
 CONFIG_SPL_SYS_I2C_LEGACY=y
-CONFIG_SYS_I2C_SPEED=1000
 CONFIG_SYS_I2C_EEPROM_ADDR=0x50
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MMC_OMAP_HS_ADMA=y
@@ -79,6 +78,8 @@ CONFIG_PHY_SMSC=y
 CONFIG_DM_MDIO=y
 CONFIG_MII=y
 CONFIG_DRIVER_TI_CPSW=y
+CONFIG_DM_PMIC=y
+# CONFIG_PMIC_CHILDREN is not set
 CONFIG_SPL_POWER_TPS65910=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
@@ -94,5 +95,4 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0xbd00
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_MASS_STORAGE=y
 CONFIG_USB_ETHER=y
-CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_WDT=y
-- 
2.34.1



[PATCH] arm: baltos: switch to driver model for the net and mdio driver

2020-02-12 Thread yegorslists
From: Yegor Yefremov 

Signed-off-by: Yegor Yefremov 
---
 configs/am335x_baltos_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/am335x_baltos_defconfig b/configs/am335x_baltos_defconfig
index 63f0da9cb0..2781d49daf 100644
--- a/configs/am335x_baltos_defconfig
+++ b/configs/am335x_baltos_defconfig
@@ -55,6 +55,8 @@ CONFIG_SYS_NAND_U_BOOT_OFFS=0x0008
 CONFIG_PHY_ADDR_ENABLE=y
 CONFIG_PHY_ATHEROS=y
 CONFIG_PHY_SMSC=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_MII=y
 CONFIG_DRIVER_TI_CPSW=y
 CONFIG_SPI=y
-- 
2.17.0



[U-Boot] [PATCH v2] arm: baltos: switch to driver model for the watchdog timer

2019-08-15 Thread yegorslists
From: Yegor Yefremov 

Signed-off-by: Yegor Yefremov 
---
Changes v1 -> v2:
rebased to include the ported omap_wdt driver

 configs/am335x_baltos_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am335x_baltos_defconfig b/configs/am335x_baltos_defconfig
index aa8fee5125..af027a3c5d 100644
--- a/configs/am335x_baltos_defconfig
+++ b/configs/am335x_baltos_defconfig
@@ -69,4 +69,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_MASS_STORAGE=y
 CONFIG_USB_ETHER=y
 CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
+CONFIG_WDT=y
 CONFIG_FAT_WRITE=y
-- 
2.17.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] arm: baltos: switch to driver model for the watchdog timer

2019-08-08 Thread yegorslists
From: Yegor Yefremov 

Also disable OMAP watchdog timer till it is converted to the
driver model.

Signed-off-by: Yegor Yefremov 
---
 configs/am335x_baltos_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/am335x_baltos_defconfig b/configs/am335x_baltos_defconfig
index aa8fee5125..6f1395925a 100644
--- a/configs/am335x_baltos_defconfig
+++ b/configs/am335x_baltos_defconfig
@@ -69,4 +69,7 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_MASS_STORAGE=y
 CONFIG_USB_ETHER=y
 CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
+# CONFIG_WATCHDOG is not set
+# CONFIG_OMAP_WATCHDOG is not set
+CONFIG_WDT=y
 CONFIG_FAT_WRITE=y
-- 
2.17.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] arm: baltos: use device tree alias to access Ethernet slave

2019-08-08 Thread yegorslists
From: Yegor Yefremov 

The full path has changed in the recent kernels so that it is
not possible to load them. Aliases "ethernet0" and "ethernet1"
are still present in both legacy and new kernels.

Also, fix error messages to correspond to the taken actions.

Signed-off-by: Yegor Yefremov 
---
 board/vscom/baltos/board.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/board/vscom/baltos/board.c b/board/vscom/baltos/board.c
index c5949ad267..036a356578 100644
--- a/board/vscom/baltos/board.c
+++ b/board/vscom/baltos/board.c
@@ -288,15 +288,15 @@ int ft_board_setup(void *blob, bd_t *bd)
mac_addr[5] = header.MAC1[5];
 
 
-   node = fdt_path_offset(blob, "/ocp/ethernet/slave@4a100200");
+   node = fdt_path_offset(blob, "ethernet0");
if (node < 0) {
-   printf("no /soc/fman/ethernet path offset\n");
+   printf("no ethernet0 path offset\n");
return -ENODEV;
}
 
ret = fdt_setprop(blob, node, "mac-address", _addr, 6);
if (ret) {
-   printf("error setting local-mac-address property\n");
+   printf("error setting mac-address property\n");
return -ENODEV;
}
 
@@ -308,15 +308,15 @@ int ft_board_setup(void *blob, bd_t *bd)
mac_addr[4] = header.MAC2[4];
mac_addr[5] = header.MAC2[5];
 
-   node = fdt_path_offset(blob, "/ocp/ethernet/slave@4a100300");
+   node = fdt_path_offset(blob, "ethernet1");
if (node < 0) {
-   printf("no /soc/fman/ethernet path offset\n");
+   printf("no ethernet1 path offset\n");
return -ENODEV;
}
 
ret = fdt_setprop(blob, node, "mac-address", _addr, 6);
if (ret) {
-   printf("error setting local-mac-address property\n");
+   printf("error setting mac-address property\n");
return -ENODEV;
}
 
-- 
2.17.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 4/4] arm: baltos: migrate Ethernet PHYs configuration to Kconfig

2018-11-22 Thread yegorslists
From: Yegor Yefremov 

Remove CONFIG_PHY_ATHEROS and CONFIG_PHY_SMSC from defconfig
and select them in Kconfig.

Signed-off-by: Yegor Yefremov 
---
 configs/am335x_baltos_defconfig | 2 ++
 include/configs/baltos.h| 4 
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/configs/am335x_baltos_defconfig b/configs/am335x_baltos_defconfig
index 74fd487097..05d41aea87 100644
--- a/configs/am335x_baltos_defconfig
+++ b/configs/am335x_baltos_defconfig
@@ -50,6 +50,8 @@ CONFIG_NAND=y
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
 CONFIG_SYS_NAND_U_BOOT_OFFS=0x0008
 CONFIG_PHY_ADDR_ENABLE=y
+CONFIG_PHY_ATHEROS=y
+CONFIG_PHY_SMSC=y
 CONFIG_MII=y
 CONFIG_DRIVER_TI_CPSW=y
 CONFIG_SPI=y
diff --git a/include/configs/baltos.h b/include/configs/baltos.h
index 7b5f652f7e..ccbdc0a335 100644
--- a/include/configs/baltos.h
+++ b/include/configs/baltos.h
@@ -257,10 +257,6 @@
 #define CONFIG_AM335X_USB1
 #define CONFIG_AM335X_USB1_MODE MUSB_OTG
 
-/* Network. */
-#define CONFIG_PHY_SMSC
-#define CONFIG_PHY_ATHEROS
-
 /* NAND support */
 #ifdef CONFIG_NAND
 #define GPMC_NAND_ECC_LP_x8_LAYOUT 1
-- 
2.17.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 3/4] arm: baltos: move CONFIG_SYS_NAND_U_BOOT_OFFS to defconfig

2018-11-22 Thread yegorslists
From: Yegor Yefremov 

Also get rid of CONFIG_SYS_NAND_SPL_KERNEL_OFFS as SPL_OS_BOOT
feature won't be used.

Signed-off-by: Yegor Yefremov 
---
 configs/am335x_baltos_defconfig | 2 ++
 include/configs/baltos.h| 9 +
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/configs/am335x_baltos_defconfig b/configs/am335x_baltos_defconfig
index 4e68956b7c..74fd487097 100644
--- a/configs/am335x_baltos_defconfig
+++ b/configs/am335x_baltos_defconfig
@@ -47,6 +47,8 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MMC_OMAP_HS_ADMA=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
+CONFIG_SYS_NAND_U_BOOT_OFFS=0x0008
 CONFIG_PHY_ADDR_ENABLE=y
 CONFIG_MII=y
 CONFIG_DRIVER_TI_CPSW=y
diff --git a/include/configs/baltos.h b/include/configs/baltos.h
index 006b049d09..7b5f652f7e 100644
--- a/include/configs/baltos.h
+++ b/include/configs/baltos.h
@@ -34,15 +34,8 @@
 /* FIT support */
 #define CONFIG_SYS_BOOTM_LEN SZ_64M
 
-/* UBI Support */
-
-/* I2C configuration */
-
 #ifdef CONFIG_NAND
-#define CONFIG_SYS_NAND_U_BOOT_OFFS0x0008
-#ifdef CONFIG_SPL_OS_BOOT
-#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x0020 /* kernel offset */
-#endif
+
 #define NANDARGS \
"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
-- 
2.17.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 1/4] arm: baltos: move the board to CONFIG_BLK

2018-11-22 Thread yegorslists
From: Yegor Yefremov 

Use DM for both MMC and USB subsystems and use dedicated DTS
for U-Boot configuration.

Disable SPL support for GPIO and remove EVMSK leftover for
DDR power control via GPIO.

Signed-off-by: Yegor Yefremov 
---
Changes v1 -> v2:
- remove GPIO7 pinmux too

 arch/arm/dts/am335x-baltos.dts  | 439 
 board/vscom/baltos/board.c  |   6 +-
 board/vscom/baltos/mux.c|   7 -
 configs/am335x_baltos_defconfig |  10 +-
 4 files changed, 447 insertions(+), 15 deletions(-)
 create mode 100644 arch/arm/dts/am335x-baltos.dts

diff --git a/arch/arm/dts/am335x-baltos.dts b/arch/arm/dts/am335x-baltos.dts
new file mode 100644
index 00..f939cf6406
--- /dev/null
+++ b/arch/arm/dts/am335x-baltos.dts
@@ -0,0 +1,439 @@
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/*
+ * VScom OnRISC
+ * http://www.vscom.de
+ */
+
+/dts-v1/;
+
+#include "am33xx.dtsi"
+#include 
+
+/ {
+   model = "OnRISC Baltos";
+   compatible = "vscom,onrisc", "ti,am33xx";
+
+   chosen {
+   stdout-path = 
+   };
+
+   cpus {
+   cpu@0 {
+   cpu0-supply = <_reg>;
+   };
+   };
+
+   vbat: fixedregulator@0 {
+   compatible = "regulator-fixed";
+   regulator-name = "vbat";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   regulator-boot-on;
+   };
+};
+
+_pinmux {
+   mmc1_pins: pinmux_mmc1_pins {
+   pinctrl-single,pins = <
+   0xf0 (MUX_MODE0 | INPUT_EN | PULL_UP)   /* 
mmc0_dat3.mmc0_dat3 */
+   0xf4 (MUX_MODE0 | INPUT_EN | PULL_UP)   /* 
mmc0_dat2.mmc0_dat2 */
+   0xf8 (MUX_MODE0 | INPUT_EN | PULL_UP)   /* 
mmc0_dat1.mmc0_dat1 */
+   0xfc (MUX_MODE0 | INPUT_EN | PULL_UP)   /* 
mmc0_dat0.mmc0_dat0 */
+   0x100 (MUX_MODE0 | INPUT_EN | PULL_UP)  /* 
mmc0_clk.mmc0_clk */
+   0x104 (MUX_MODE0 | INPUT_EN | PULL_UP)  /* 
mmc0_cmd.mmc0_cmd */
+   >;
+   };
+
+   i2c1_pins: pinmux_i2c1_pins {
+   pinctrl-single,pins = <
+   0x158 0x2a  /* spi0_d1.i2c1_sda_mux3, INPUT | MODE2 
*/
+   0x15c 0x2a  /* spi0_cs0.i2c1_scl_mux3, INPUT | 
MODE2 */
+   >;
+   };
+
+   tps65910_pins: pinmux_tps65910_pins {
+   pinctrl-single,pins = <
+   0x078 (PIN_INPUT_PULLUP | MUX_MODE7)  /* 
gpmc_ben1.gpio1[28] */
+   >;
+
+   };
+   tca6416_pins: pinmux_tca6416_pins {
+   pinctrl-single,pins = <
+   AM33XX_IOPAD(0x9b4, PIN_INPUT_PULLUP | MUX_MODE7)  
/* xdma_event_intr1.gpio0[20] tca6416 stuff */
+   >;
+   };
+
+   uart0_pins: pinmux_uart0_pins {
+   pinctrl-single,pins = <
+   0x170 (PIN_INPUT_PULLUP | MUX_MODE0)/* 
uart0_rxd.uart0_rxd */
+   0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* 
uart0_txd.uart0_txd */
+   >;
+   };
+
+   cpsw_default: cpsw_default {
+   pinctrl-single,pins = <
+   /* Slave 1 */
+   0x10c (PIN_INPUT_PULLDOWN | MUX_MODE1)   /* 
mii1_crs.rmii1_crs_dv */
+   0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)  /* 
mii1_tx_en.rmii1_txen */
+   0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)  /* 
mii1_txd1.rmii1_txd1 */
+   0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)  /* 
mii1_txd0.rmii1_txd0 */
+   0x13c (PIN_INPUT_PULLDOWN | MUX_MODE1)  /* 
mii1_rxd1.rmii1_rxd1 */
+   0x140 (PIN_INPUT_PULLDOWN | MUX_MODE1)  /* 
mii1_rxd0.rmii1_rxd0 */
+   0x144 (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* 
rmii1_ref_clk.rmii1_refclk */
+
+
+   /* Slave 2 */
+   0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* 
gpmc_a0.rgmii2_tctl */
+   0x44 (PIN_INPUT_PULLDOWN | MUX_MODE2)   /* 
gpmc_a1.rgmii2_rctl */
+   0x48 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* 
gpmc_a2.rgmii2_td3 */
+   0x4c (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* 
gpmc_a3.rgmii2_td2 */
+   0x50 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* 
gpmc_a4.rgmii2_td1 */
+   0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* 
gpmc_a5.rgmii2_td0 */
+   0x58 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* 
gpmc_a6.rgmii2_tclk */
+   0x5c (PIN_INPUT_PULLDOWN | MUX_MODE2)   /* 
gpmc_a7.rgmii2_rclk */
+

[U-Boot] [PATCH v2 2/4] arm: baltos: remove unused header

2018-11-22 Thread yegorslists
From: Yegor Yefremov 

OnRISC Baltos series uses SoM with tps65910 PMIC, so remove
"power/tps65217.h" header inclusion.

Signed-off-by: Yegor Yefremov 
---
 board/vscom/baltos/board.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/board/vscom/baltos/board.c b/board/vscom/baltos/board.c
index 60651f501f..c5949ad267 100644
--- a/board/vscom/baltos/board.c
+++ b/board/vscom/baltos/board.c
@@ -27,7 +27,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-- 
2.17.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] arm: baltos: move the board to CONFIG_BLK

2018-11-20 Thread yegorslists
From: Yegor Yefremov 

Use DM for both MMC and USB subsystems and use dedicated DTS
for U-Boot configuration.

Disable SPL support for GPIO and remove EVMSK leftover for
DDR power control via GPIO.

Signed-off-by: Yegor Yefremov 
---
 arch/arm/dts/am335x-baltos.dts  | 439 
 board/vscom/baltos/board.c  |   6 +-
 configs/am335x_baltos_defconfig |  10 +-
 3 files changed, 447 insertions(+), 8 deletions(-)
 create mode 100644 arch/arm/dts/am335x-baltos.dts

diff --git a/arch/arm/dts/am335x-baltos.dts b/arch/arm/dts/am335x-baltos.dts
new file mode 100644
index 00..f939cf6406
--- /dev/null
+++ b/arch/arm/dts/am335x-baltos.dts
@@ -0,0 +1,439 @@
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/*
+ * VScom OnRISC
+ * http://www.vscom.de
+ */
+
+/dts-v1/;
+
+#include "am33xx.dtsi"
+#include 
+
+/ {
+   model = "OnRISC Baltos";
+   compatible = "vscom,onrisc", "ti,am33xx";
+
+   chosen {
+   stdout-path = 
+   };
+
+   cpus {
+   cpu@0 {
+   cpu0-supply = <_reg>;
+   };
+   };
+
+   vbat: fixedregulator@0 {
+   compatible = "regulator-fixed";
+   regulator-name = "vbat";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   regulator-boot-on;
+   };
+};
+
+_pinmux {
+   mmc1_pins: pinmux_mmc1_pins {
+   pinctrl-single,pins = <
+   0xf0 (MUX_MODE0 | INPUT_EN | PULL_UP)   /* 
mmc0_dat3.mmc0_dat3 */
+   0xf4 (MUX_MODE0 | INPUT_EN | PULL_UP)   /* 
mmc0_dat2.mmc0_dat2 */
+   0xf8 (MUX_MODE0 | INPUT_EN | PULL_UP)   /* 
mmc0_dat1.mmc0_dat1 */
+   0xfc (MUX_MODE0 | INPUT_EN | PULL_UP)   /* 
mmc0_dat0.mmc0_dat0 */
+   0x100 (MUX_MODE0 | INPUT_EN | PULL_UP)  /* 
mmc0_clk.mmc0_clk */
+   0x104 (MUX_MODE0 | INPUT_EN | PULL_UP)  /* 
mmc0_cmd.mmc0_cmd */
+   >;
+   };
+
+   i2c1_pins: pinmux_i2c1_pins {
+   pinctrl-single,pins = <
+   0x158 0x2a  /* spi0_d1.i2c1_sda_mux3, INPUT | MODE2 
*/
+   0x15c 0x2a  /* spi0_cs0.i2c1_scl_mux3, INPUT | 
MODE2 */
+   >;
+   };
+
+   tps65910_pins: pinmux_tps65910_pins {
+   pinctrl-single,pins = <
+   0x078 (PIN_INPUT_PULLUP | MUX_MODE7)  /* 
gpmc_ben1.gpio1[28] */
+   >;
+
+   };
+   tca6416_pins: pinmux_tca6416_pins {
+   pinctrl-single,pins = <
+   AM33XX_IOPAD(0x9b4, PIN_INPUT_PULLUP | MUX_MODE7)  
/* xdma_event_intr1.gpio0[20] tca6416 stuff */
+   >;
+   };
+
+   uart0_pins: pinmux_uart0_pins {
+   pinctrl-single,pins = <
+   0x170 (PIN_INPUT_PULLUP | MUX_MODE0)/* 
uart0_rxd.uart0_rxd */
+   0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* 
uart0_txd.uart0_txd */
+   >;
+   };
+
+   cpsw_default: cpsw_default {
+   pinctrl-single,pins = <
+   /* Slave 1 */
+   0x10c (PIN_INPUT_PULLDOWN | MUX_MODE1)   /* 
mii1_crs.rmii1_crs_dv */
+   0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)  /* 
mii1_tx_en.rmii1_txen */
+   0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)  /* 
mii1_txd1.rmii1_txd1 */
+   0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)  /* 
mii1_txd0.rmii1_txd0 */
+   0x13c (PIN_INPUT_PULLDOWN | MUX_MODE1)  /* 
mii1_rxd1.rmii1_rxd1 */
+   0x140 (PIN_INPUT_PULLDOWN | MUX_MODE1)  /* 
mii1_rxd0.rmii1_rxd0 */
+   0x144 (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* 
rmii1_ref_clk.rmii1_refclk */
+
+
+   /* Slave 2 */
+   0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* 
gpmc_a0.rgmii2_tctl */
+   0x44 (PIN_INPUT_PULLDOWN | MUX_MODE2)   /* 
gpmc_a1.rgmii2_rctl */
+   0x48 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* 
gpmc_a2.rgmii2_td3 */
+   0x4c (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* 
gpmc_a3.rgmii2_td2 */
+   0x50 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* 
gpmc_a4.rgmii2_td1 */
+   0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* 
gpmc_a5.rgmii2_td0 */
+   0x58 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* 
gpmc_a6.rgmii2_tclk */
+   0x5c (PIN_INPUT_PULLDOWN | MUX_MODE2)   /* 
gpmc_a7.rgmii2_rclk */
+   0x60 (PIN_INPUT_PULLDOWN | MUX_MODE2)   /* 
gpmc_a8.rgmii2_rd3 */
+   

[U-Boot] [PATCH 3/3] arm: baltos: enable booting from USB

2016-12-01 Thread yegorslists
From: Yegor Yefremov 

First of all U-Boot would search for a USB mass storage device
with either uEnv.txt or kernel-fit.itb and boot.

If USB mass storage device is not available or doesn't provide
these files then MMC will be tried.

Signed-off-by: Yegor Yefremov 
---
 include/configs/baltos.h | 33 +
 1 file changed, 33 insertions(+)

diff --git a/include/configs/baltos.h b/include/configs/baltos.h
index 8efd513..06f5ceb 100644
--- a/include/configs/baltos.h
+++ b/include/configs/baltos.h
@@ -102,7 +102,9 @@
"optargs=\0" \
"mmcdev=0\0" \
"mmcroot=/dev/mmcblk0p2 ro\0" \
+   "usbroot=/dev/sda2 ro\0" \
"mmcrootfstype=ext4 rootwait\0" \
+   "usbrootfstype=ext4 rootwait\0" \
"rootpath=/export/rootfs\0" \
"nfsopts=nolock\0" \
"static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
@@ -114,6 +116,11 @@
"${mtdparts} " \
"root=${mmcroot} " \
"rootfstype=${mmcrootfstype}\0" \
+   "usbargs=setenv bootargs console=${console} " \
+   "${optargs} " \
+   "${mtdparts} " \
+   "root=${usbroot} " \
+   "rootfstype=${usbrootfstype}\0" \
"spiroot=/dev/mtdblock4 rw\0" \
"spirootfstype=jffs2\0" \
"spisrcaddr=0xe\0" \
@@ -130,15 +137,25 @@
"ip=dhcp\0" \
"bootenv=uEnv.txt\0" \
"loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
+   "usbloadbootenv=load usb 0:1 ${loadaddr} ${bootenv}\0" \
"importbootenv=echo Importing environment from mmc ...; " \
"env import -t $loadaddr $filesize\0" \
+   "usbimportbootenv=echo Importing environment from USB ...; " \
+   "env import -t $loadaddr $filesize\0" \
"ramargs=setenv bootargs console=${console} " \
"${optargs} " \
"root=${ramroot} " \
"rootfstype=${ramrootfstype}\0" \
"loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
"loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
+   "usbloadimage=load usb 0:1 ${loadaddr} kernel-fit.itb\0" \
"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
+   "usbloados=run usbargs; " \
+   "bootm ${loadaddr}#conf${board_name}; " \
+   "if test $? -ne 0; then " \
+   "echo Using default FIT configuration; " \
+   "bootm ${loadaddr}; " \
+   "fi;\0" \
"mmcloados=run mmcargs; " \
"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
"if run loadfdt; then " \
@@ -153,6 +170,21 @@
"else " \
"bootz; " \
"fi;\0" \
+   "usbboot=usb reset; " \
+   "if usb storage; then " \
+   "echo USB drive found;" \
+   "if run usbloadbootenv; then " \
+   "echo Loaded environment from ${bootenv};" \
+   "run usbimportbootenv;" \
+   "fi;" \
+   "if test -n $uenvcmd; then " \
+   "echo Running uenvcmd ...;" \
+   "run uenvcmd;" \
+   "fi;" \
+   "if run usbloadimage; then " \
+   "run usbloados;" \
+   "fi;" \
+   "fi;\0" \
"mmcboot=mmc dev ${mmcdev}; " \
"if mmc rescan; then " \
"echo SD/MMC found on device ${mmcdev};" \
@@ -190,6 +222,7 @@
 
 #define CONFIG_BOOTCOMMAND \
"run findfdt; " \
+   "run usbboot;" \
"run mmcboot;" \
"setenv mmcdev 1; " \
"setenv bootpart 1:2; " \
-- 
2.1.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/3] arm: baltos: active mPCIe slot

2016-12-01 Thread yegorslists
From: Yegor Yefremov 

Baltos devices provide a mPCIe slot, whose power is turned off by
default. This patch activates mPCIe slot in U-Boot, so that for example
GSM modem can be already available in user space.

Signed-off-by: Yegor Yefremov 
---
 board/vscom/baltos/board.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/board/vscom/baltos/board.c b/board/vscom/baltos/board.c
index dbf79a5..d3b1f15 100644
--- a/board/vscom/baltos/board.c
+++ b/board/vscom/baltos/board.c
@@ -39,6 +39,7 @@ DECLARE_GLOBAL_DATA_PTR;
 /* GPIO that controls power to DDR on EVM-SK */
 #define GPIO_DDR_VTT_EN7
 #define DIP_S1 44
+#define MPCIE_SW   100
 
 static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 
@@ -330,6 +331,11 @@ int ft_board_setup(void *blob, bd_t *bd)
return 0;
 }
 
+static struct module_pin_mux pcie_sw_pin_mux[] = {
+   {OFFSET(mii1_rxdv), (MODE(7) | PULLUDEN )}, /* GPIO3_4 */
+   {-1},
+};
+
 static struct module_pin_mux dip_pin_mux[] = {
{OFFSET(gpmc_ad12), (MODE(7) | RXACTIVE )}, /* GPIO1_12 */
{OFFSET(gpmc_ad13), (MODE(7)  | RXACTIVE )},/* GPIO1_13 */
@@ -355,6 +361,18 @@ int board_late_init(void)
baltos_set_console();
}
}
+
+   /* turn power for the mPCIe slot */
+   configure_module_pin_mux(pcie_sw_pin_mux);
+   if (gpio_request(MPCIE_SW, "mpcie_sw")) {
+   printf("failed to export GPIO %d\n", MPCIE_SW);
+   return -ENODEV;
+   }
+   if (gpio_direction_output(MPCIE_SW, 1)) {
+   printf("failed to set GPIO %d direction\n", MPCIE_SW);
+   return -ENODEV;
+   }
+
setenv("board_name", model);
 #endif
 
-- 
2.1.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3] arm: baltos: remove TI board leftover

2016-12-01 Thread yegorslists
From: Yegor Yefremov 

Remove unneeded pinmux configurations and TI EEPROM struct.

Signed-off-by: Yegor Yefremov 
---
 board/vscom/baltos/board.c |  1 -
 board/vscom/baltos/board.h | 55 
 board/vscom/baltos/mux.c   | 69 --
 3 files changed, 125 deletions(-)

diff --git a/board/vscom/baltos/board.c b/board/vscom/baltos/board.c
index 27056e1..dbf79a5 100644
--- a/board/vscom/baltos/board.c
+++ b/board/vscom/baltos/board.c
@@ -415,7 +415,6 @@ int board_eth_init(bd_t *bis)
int rv, n = 0;
uint8_t mac_addr[6];
uint32_t mac_hi, mac_lo;
-   __maybe_unused struct am335x_baseboard_id header;
 
/*
 * Note here that we're using CPSW1 since that has a 1Gbit PHY while
diff --git a/board/vscom/baltos/board.h b/board/vscom/baltos/board.h
index bcdb648..40ddd90 100644
--- a/board/vscom/baltos/board.h
+++ b/board/vscom/baltos/board.h
@@ -11,24 +11,6 @@
 #ifndef _BOARD_H_
 #define _BOARD_H_
 
-/*
- * TI AM335x parts define a system EEPROM that defines certain sub-fields.
- * We use these fields to in turn see what board we are on, and what
- * that might require us to set or not set.
- */
-#define HDR_NO_OF_MAC_ADDR 3
-#define HDR_ETH_ALEN   6
-#define HDR_NAME_LEN   8
-
-struct am335x_baseboard_id {
-   unsigned int  magic;
-   char name[HDR_NAME_LEN];
-   char version[4];
-   char serial[12];
-   char config[32];
-   char mac_addr[HDR_NO_OF_MAC_ADDR][HDR_ETH_ALEN];
-};
-
 typedef struct _BSP_VS_HWPARAM// v1.0
 {
uint32_t Magic;
@@ -41,37 +23,6 @@ typedef struct _BSP_VS_HWPARAM// v1.0
uint8_t MAC3[6];// WL1271 WLAN
 } __attribute__ ((packed)) BSP_VS_HWPARAM;
 
-static inline int board_is_bone(struct am335x_baseboard_id *header)
-{
-   return !strncmp(header->name, "A335BONE", HDR_NAME_LEN);
-}
-
-static inline int board_is_bone_lt(struct am335x_baseboard_id *header)
-{
-   return !strncmp(header->name, "A335BNLT", HDR_NAME_LEN);
-}
-
-static inline int board_is_evm_sk(struct am335x_baseboard_id *header)
-{
-   return !strncmp("A335X_SK", header->name, HDR_NAME_LEN);
-}
-
-static inline int board_is_idk(struct am335x_baseboard_id *header)
-{
-   return !strncmp(header->config, "SKU#02", 6);
-}
-
-static inline int board_is_gp_evm(struct am335x_baseboard_id *header)
-{
-   return !strncmp("A33515BB", header->name, HDR_NAME_LEN);
-}
-
-static inline int board_is_evm_15_or_later(struct am335x_baseboard_id *header)
-{
-   return (board_is_gp_evm(header) &&
-   strncmp("1.5", header->version, 3) <= 0);
-}
-
 /*
  * We have three pin mux functions that must exist.  We must be able to enable
  * uart0, for initial output and i2c0 to read the main EEPROM.  We then have a
@@ -79,12 +30,6 @@ static inline int board_is_evm_15_or_later(struct 
am335x_baseboard_id *header)
  * is required on the board.
  */
 void enable_uart0_pin_mux(void);
-void enable_uart1_pin_mux(void);
-void enable_uart2_pin_mux(void);
-void enable_uart3_pin_mux(void);
-void enable_uart4_pin_mux(void);
-void enable_uart5_pin_mux(void);
-void enable_i2c0_pin_mux(void);
 void enable_i2c1_pin_mux(void);
 void enable_board_pin_mux(void);
 #endif
diff --git a/board/vscom/baltos/mux.c b/board/vscom/baltos/mux.c
index 8783b25..94410ae 100644
--- a/board/vscom/baltos/mux.c
+++ b/board/vscom/baltos/mux.c
@@ -27,36 +27,6 @@ static struct module_pin_mux uart0_pin_mux[] = {
{-1},
 };
 
-static struct module_pin_mux uart1_pin_mux[] = {
-   {OFFSET(uart1_rxd), (MODE(0) | PULLUP_EN | RXACTIVE)},  /* UART1_RXD */
-   {OFFSET(uart1_txd), (MODE(0) | PULLUDEN)},  /* UART1_TXD */
-   {-1},
-};
-
-static struct module_pin_mux uart2_pin_mux[] = {
-   {OFFSET(spi0_sclk), (MODE(1) | PULLUP_EN | RXACTIVE)},  /* UART2_RXD */
-   {OFFSET(spi0_d0), (MODE(1) | PULLUDEN)},/* UART2_TXD */
-   {-1},
-};
-
-static struct module_pin_mux uart3_pin_mux[] = {
-   {OFFSET(spi0_cs1), (MODE(1) | PULLUP_EN | RXACTIVE)},   /* UART3_RXD */
-   {OFFSET(ecap0_in_pwm0_out), (MODE(1) | PULLUDEN)},  /* UART3_TXD */
-   {-1},
-};
-
-static struct module_pin_mux uart4_pin_mux[] = {
-   {OFFSET(gpmc_wait0), (MODE(6) | PULLUP_EN | RXACTIVE)}, /* UART4_RXD */
-   {OFFSET(gpmc_wpn), (MODE(6) | PULLUDEN)},   /* UART4_TXD */
-   {-1},
-};
-
-static struct module_pin_mux uart5_pin_mux[] = {
-   {OFFSET(lcd_data9), (MODE(4) | PULLUP_EN | RXACTIVE)},  /* UART5_RXD */
-   {OFFSET(lcd_data8), (MODE(4) | PULLUDEN)},  /* UART5_TXD */
-   {-1},
-};
-
 static struct module_pin_mux mmc0_pin_mux[] = {
{OFFSET(mmc0_dat3), (MODE(0) | RXACTIVE | PULLUP_EN)},  /* MMC0_DAT3 */
{OFFSET(mmc0_dat2), (MODE(0) | RXACTIVE | PULLUP_EN)},  /* MMC0_DAT2 */
@@ -68,14 +38,6 @@ static struct module_pin_mux mmc0_pin_mux[] = 

[U-Boot] [PATCH] am3517_evm: add FIT support

2015-07-27 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Enable DTS support (CONFIG_OF_LIBFDT), create ft_board_setup()
stub and select CONFIG_FIT in defconfig.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 board/logicpd/am3517evm/am3517evm.c | 5 +
 configs/am3517_evm_defconfig| 1 +
 include/configs/am3517_evm.h| 3 +++
 3 files changed, 9 insertions(+)

diff --git a/board/logicpd/am3517evm/am3517evm.c 
b/board/logicpd/am3517evm/am3517evm.c
index 24be6ea..cd37f85 100644
--- a/board/logicpd/am3517evm/am3517evm.c
+++ b/board/logicpd/am3517evm/am3517evm.c
@@ -50,6 +50,11 @@ int board_init(void)
return 0;
 }
 
+int ft_board_setup(void *blob, bd_t *bd)
+{
+   return 0;
+}
+
 #ifdef CONFIG_USB_MUSB_AM35X
 static struct musb_hdrc_config musb_config = {
.multipoint = 1,
diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig
index 4589b30..c72d29e 100644
--- a/configs/am3517_evm_defconfig
+++ b/configs/am3517_evm_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_OMAP34XX=y
 CONFIG_TARGET_AM3517_EVM=y
 CONFIG_SPL=y
+CONFIG_FIT=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
index b90a60d..c0ac5dc 100644
--- a/include/configs/am3517_evm.h
+++ b/include/configs/am3517_evm.h
@@ -42,6 +42,9 @@
 
 #define CONFIG_MISC_INIT_R
 
+#define CONFIG_OF_LIBFDT
+#define CONFIG_OF_BOARD_SETUP
+
 #define CONFIG_CMDLINE_TAG 1   /* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS   1
 #define CONFIG_INITRD_TAG  1
-- 
2.1.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] am3517_evm: add FIT support

2015-07-27 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Enable DTS support (CONFIG_OF_LIBFDT) and select
CONFIG_FIT in defconfig.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
Changes:
v2: remove unused ft_board_setup() and CONFIG_OF_BOARD_SETUP

 configs/am3517_evm_defconfig | 1 +
 include/configs/am3517_evm.h | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig
index 4589b30..c72d29e 100644
--- a/configs/am3517_evm_defconfig
+++ b/configs/am3517_evm_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_OMAP34XX=y
 CONFIG_TARGET_AM3517_EVM=y
 CONFIG_SPL=y
+CONFIG_FIT=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
index b90a60d..e9808a7 100644
--- a/include/configs/am3517_evm.h
+++ b/include/configs/am3517_evm.h
@@ -42,6 +42,8 @@
 
 #define CONFIG_MISC_INIT_R
 
+#define CONFIG_OF_LIBFDT
+
 #define CONFIG_CMDLINE_TAG 1   /* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS   1
 #define CONFIG_INITRD_TAG  1
-- 
2.1.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arm: convert am3517_crane and am3517_evm to generic boards

2015-06-30 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Add CONFIG_SYS_GENERIC_BOARD to board's config header.

Boot-tested on am3517_evm board.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 include/configs/am3517_crane.h |1 +
 include/configs/am3517_evm.h   |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/configs/am3517_crane.h b/include/configs/am3517_crane.h
index 2f4117d..6a0240b 100644
--- a/include/configs/am3517_crane.h
+++ b/include/configs/am3517_crane.h
@@ -19,6 +19,7 @@
 #define CONFIG_OMAP1   /* in a TI OMAP core */
 #define CONFIG_OMAP3_AM3517CRANE   1   /* working with CRANEBOARD */
 #define CONFIG_OMAP_COMMON
+#define CONFIG_SYS_GENERIC_BOARD
 /* Common ARM Erratas */
 #define CONFIG_ARM_ERRATA_454179
 #define CONFIG_ARM_ERRATA_430973
diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
index e5b4621..b90a60d 100644
--- a/include/configs/am3517_evm.h
+++ b/include/configs/am3517_evm.h
@@ -19,6 +19,7 @@
 #define CONFIG_OMAP1   /* in a TI OMAP core */
 #define CONFIG_OMAP3_AM3517EVM 1   /* working with AM3517EVM */
 #define CONFIG_OMAP_COMMON
+#define CONFIG_SYS_GENERIC_BOARD
 /* Common ARM Erratas */
 #define CONFIG_ARM_ERRATA_454179
 #define CONFIG_ARM_ERRATA_430973
-- 
1.7.7

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Baltos: enable CMD_NET in defconfig

2015-06-25 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 configs/am335x_baltos_defconfig |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configs/am335x_baltos_defconfig b/configs/am335x_baltos_defconfig
index 679b04f..4d2f075 100644
--- a/configs/am335x_baltos_defconfig
+++ b/configs/am335x_baltos_defconfig
@@ -1,7 +1,7 @@
+CONFIG_ARM=y
+CONFIG_TARGET_AM335X_BALTOS=y
+CONFIG_CMD_NET=y
 CONFIG_SPL=y
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_ADDR=0x8200
 CONFIG_SYS_EXTRA_OPTIONS=NAND
-CONFIG_CONS_INDEX=1
-CONFIG_ARM=y
-CONFIG_TARGET_AM335X_BALTOS=y
-- 
1.7.7

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] FIT: workarounding wrong configuration name

2015-05-04 Thread yegorslists
In our project we read device ID from EEPROM and then select an appropriate
configuration bootm ${loadaddr}#conf${board_name}. If for some reason wrong
ID was written into EEPROM, then it is still important, that device can still
be booted with default configuration.

One can still put a big warning, saying, that provided configuration is missing
and that the system is using default one.

What do you think about this?

Regards,
Yegor

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC] FIT: use default configuration, if given configuration is not found

2015-05-04 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 common/image-fit.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/common/image-fit.c b/common/image-fit.c
index c61be65..b892d06 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1547,6 +1547,10 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
} else {
cfg_noffset = fit_conf_get_node(fit,
fit_uname_config);
+
+   if (cfg_noffset  0) {
+   cfg_noffset = fit_conf_get_node(fit, NULL);
+   }
}
if (cfg_noffset  0) {
puts(Could not find configuration node\n);
-- 
1.7.7

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] am33xx: add SSC enable macro

2014-04-10 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 arch/arm/include/asm/arch-am33xx/clock.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-am33xx/clock.h 
b/arch/arm/include/asm/arch-am33xx/clock.h
index 7637457..f00fad3 100644
--- a/arch/arm/include/asm/arch-am33xx/clock.h
+++ b/arch/arm/include/asm/arch-am33xx/clock.h
@@ -42,6 +42,8 @@
 #define MODULE_CLKCTRL_IDLEST_DISABLED 3
 
 /* CM_CLKMODE_DPLL */
+#define CM_CLKMODE_DPLL_SSC_EN_SHIFT   12
+#define CM_CLKMODE_DPLL_SSC_EN_MASK(1  12)
 #define CM_CLKMODE_DPLL_REGM4XEN_SHIFT 11
 #define CM_CLKMODE_DPLL_REGM4XEN_MASK  (1  11)
 #define CM_CLKMODE_DPLL_LPMODE_EN_SHIFT10
-- 
1.7.7

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] am3517_evm: Ethernet activation

2013-12-11 Thread yegorslists
This patch continues Tom's effort in activating Ethernet on am3517_evm board
(http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot/u-boot-arm.git;a=commit;h=18a02e8050b7af165efa72325753e7880bf5567c).

I've removed #if statements, because in include/configs/am3517_evm.h EMAC is 
activated by default. I've also enebled
CONFIG_OMAP_GPIO (needed to turn pin 30 on).

Patch created against u-boot/u-boot-ti.git

Yegor

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v4] am3517_evm: activate Ethernet PHY

2013-12-11 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Pin 30 is connected to PHY's RESET# signal, so it must be
put to high. Otherwise PHY won't be found via MDIO interface.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
Changes:
v4: as Tom Rini's patch AM3517 EVM: Enable Ethernet activates EMAC by 
default, remove #if statements
v3: use __maybe_unused, instead of #if defined statement (Stefan 
Roese)
v2: put ctr and reset under #if defined statement, to avoid compiler 
warnings, when EMAC is not selected

 board/logicpd/am3517evm/am3517evm.c |   32 
 board/logicpd/am3517evm/am3517evm.h |2 +-
 include/configs/am3517_evm.h|5 +
 3 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/board/logicpd/am3517evm/am3517evm.c 
b/board/logicpd/am3517evm/am3517evm.c
index b6c68da..5196b5d 100644
--- a/board/logicpd/am3517evm/am3517evm.c
+++ b/board/logicpd/am3517evm/am3517evm.c
@@ -22,6 +22,7 @@
 #include asm/arch/musb.h
 #include asm/mach-types.h
 #include asm/errno.h
+#include asm/gpio.h
 #include linux/usb/ch9.h
 #include linux/usb/gadget.h
 #include linux/usb/musb.h
@@ -31,6 +32,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define AM3517_IP_SW_RESET 0x48002598
+#define CPGMACSS_SW_RST(1  1)
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -98,6 +102,9 @@ static void am3517_evm_musb_init(void)
  */
 int misc_init_r(void)
 {
+   volatile unsigned int ctr;
+   u32 reset;
+
 #ifdef CONFIG_DRIVER_OMAP34XX_I2C
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 #endif
@@ -106,6 +113,31 @@ int misc_init_r(void)
 
am3517_evm_musb_init();
 
+   /* activate PHY reset */
+   gpio_direction_output(30, 0);
+   gpio_set_value(30, 0);
+
+   ctr  = 0;
+   do {
+   udelay(1000);
+   ctr++;
+   } while (ctr  300);
+
+   /* deactivate PHY reset */
+   gpio_set_value(30, 1);
+
+   /* allow the PHY to stabilize and settle down */
+   ctr = 0;
+   do {
+   udelay(1000);
+   ctr++;
+   } while (ctr  300);
+
+   /* ensure that the module is out of reset */
+   reset = readl(AM3517_IP_SW_RESET);
+   reset = (~CPGMACSS_SW_RST);
+   writel(reset,AM3517_IP_SW_RESET);
+
return 0;
 }
 
diff --git a/board/logicpd/am3517evm/am3517evm.h 
b/board/logicpd/am3517evm/am3517evm.h
index 704af84..d407d66 100644
--- a/board/logicpd/am3517evm/am3517evm.h
+++ b/board/logicpd/am3517evm/am3517evm.h
@@ -315,7 +315,7 @@ const omap3_sysinfo sysinfo = {
MUX_VAL(CP(SYS_CLKREQ), (IEN  | PTD | DIS | M0)) \
MUX_VAL(CP(SYS_NIRQ),   (IEN  | PTU | EN  | M0)) \
/*SYS_nRESWARM */\
-   MUX_VAL(CP(SYS_NRESWARM),   (IDIS | PTU | DIS | M4)) \
+   MUX_VAL(CP(SYS_NRESWARM),   (IDIS | PTU | EN | M4)) \
/* - GPIO30 */\
MUX_VAL(CP(SYS_BOOT0),  (IEN  | PTD | DIS | M4)) /*GPIO_2*/\
 /* - PEN_IRQ */\
diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
index 5e259f5..e22a46b 100644
--- a/include/configs/am3517_evm.h
+++ b/include/configs/am3517_evm.h
@@ -58,6 +58,11 @@
  */
 
 /*
+ * OMAP GPIO configuration
+ */
+#define CONFIG_OMAP_GPIO
+
+/*
  * NS16550 Configuration
  */
 #define V_NS16550_CLK  4800/* 48MHz (APLL96/2) */
-- 
1.7.7

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] am3517_evm: activate Ethernet PHY

2013-12-06 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Pin 30 is connected to PHY's RESET# signal, so it must be
put to high. Otherwise PHY won't be found via MDIO interface.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
Changes:
v2: put ctr and reset under #if defined statement. to avoid 
compilerwarnigs, when EMAC is not selected

 board/logicpd/am3517evm/am3517evm.c |   36 +++
 board/logicpd/am3517evm/am3517evm.h |2 +-
 2 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/board/logicpd/am3517evm/am3517evm.c 
b/board/logicpd/am3517evm/am3517evm.c
index 1569905..a917a03 100644
--- a/board/logicpd/am3517evm/am3517evm.c
+++ b/board/logicpd/am3517evm/am3517evm.c
@@ -22,6 +22,7 @@
 #include asm/arch/musb.h
 #include asm/mach-types.h
 #include asm/errno.h
+#include asm/gpio.h
 #include linux/usb/ch9.h
 #include linux/usb/gadget.h
 #include linux/usb/musb.h
@@ -31,6 +32,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define AM3517_IP_SW_RESET 0x48002598
+#define CPGMACSS_SW_RST(1  1)
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -98,6 +102,11 @@ static void am3517_evm_musb_init(void)
  */
 int misc_init_r(void)
 {
+#if defined(CONFIG_DRIVER_TI_EMAC)
+   volatile unsigned int ctr;
+   u32 reset;
+#endif
+
 #ifdef CONFIG_SYS_I2C_OMAP34XX
i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
 #endif
@@ -106,6 +115,33 @@ int misc_init_r(void)
 
am3517_evm_musb_init();
 
+#if defined(CONFIG_DRIVER_TI_EMAC)
+   /* activate PHY reset */
+   gpio_direction_output(30, 0);
+   gpio_set_value(30, 0);
+
+   ctr  = 0;
+   do {
+   udelay(1000);
+   ctr++;
+   } while (ctr  300);
+
+   /* deactivate PHY reset */
+   gpio_set_value(30, 1);
+
+   /* allow the PHY to stabilize and settle down */
+   ctr = 0;
+   do {
+   udelay(1000);
+   ctr++;
+   } while (ctr  300);
+
+   /* ensure that the module is out of reset */
+   reset = readl(AM3517_IP_SW_RESET);
+   reset = (~CPGMACSS_SW_RST);
+   writel(reset,AM3517_IP_SW_RESET);
+#endif
+
return 0;
 }
 
diff --git a/board/logicpd/am3517evm/am3517evm.h 
b/board/logicpd/am3517evm/am3517evm.h
index 704af84..d407d66 100644
--- a/board/logicpd/am3517evm/am3517evm.h
+++ b/board/logicpd/am3517evm/am3517evm.h
@@ -315,7 +315,7 @@ const omap3_sysinfo sysinfo = {
MUX_VAL(CP(SYS_CLKREQ), (IEN  | PTD | DIS | M0)) \
MUX_VAL(CP(SYS_NIRQ),   (IEN  | PTU | EN  | M0)) \
/*SYS_nRESWARM */\
-   MUX_VAL(CP(SYS_NRESWARM),   (IDIS | PTU | DIS | M4)) \
+   MUX_VAL(CP(SYS_NRESWARM),   (IDIS | PTU | EN | M4)) \
/* - GPIO30 */\
MUX_VAL(CP(SYS_BOOT0),  (IEN  | PTD | DIS | M4)) /*GPIO_2*/\
 /* - PEN_IRQ */\
-- 
1.7.7

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3] am3517_evm: activate Ethernet PHY

2013-12-06 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Pin 30 is connected to PHY's RESET# signal, so it must be
put to high. Otherwise PHY won't be found via MDIO interface.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
Changes:
v3: use __maybe_unused, instead of #if defined statement (Stefan 
Roese)
v2: put ctr and reset under #if defined statement, to avoid compiler 
warnings, when EMAC is not selected

 board/logicpd/am3517evm/am3517evm.c |   34 ++
 board/logicpd/am3517evm/am3517evm.h |2 +-
 2 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/board/logicpd/am3517evm/am3517evm.c 
b/board/logicpd/am3517evm/am3517evm.c
index 1569905..3b1dfd1 100644
--- a/board/logicpd/am3517evm/am3517evm.c
+++ b/board/logicpd/am3517evm/am3517evm.c
@@ -22,6 +22,7 @@
 #include asm/arch/musb.h
 #include asm/mach-types.h
 #include asm/errno.h
+#include asm/gpio.h
 #include linux/usb/ch9.h
 #include linux/usb/gadget.h
 #include linux/usb/musb.h
@@ -31,6 +32,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define AM3517_IP_SW_RESET 0x48002598
+#define CPGMACSS_SW_RST(1  1)
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -98,6 +102,9 @@ static void am3517_evm_musb_init(void)
  */
 int misc_init_r(void)
 {
+   __maybe_unused volatile unsigned int ctr;
+   __maybe_unused u32 reset;
+
 #ifdef CONFIG_SYS_I2C_OMAP34XX
i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
 #endif
@@ -106,6 +113,33 @@ int misc_init_r(void)
 
am3517_evm_musb_init();
 
+#if defined(CONFIG_DRIVER_TI_EMAC)
+   /* activate PHY reset */
+   gpio_direction_output(30, 0);
+   gpio_set_value(30, 0);
+
+   ctr  = 0;
+   do {
+   udelay(1000);
+   ctr++;
+   } while (ctr  300);
+
+   /* deactivate PHY reset */
+   gpio_set_value(30, 1);
+
+   /* allow the PHY to stabilize and settle down */
+   ctr = 0;
+   do {
+   udelay(1000);
+   ctr++;
+   } while (ctr  300);
+
+   /* ensure that the module is out of reset */
+   reset = readl(AM3517_IP_SW_RESET);
+   reset = (~CPGMACSS_SW_RST);
+   writel(reset,AM3517_IP_SW_RESET);
+#endif
+
return 0;
 }
 
diff --git a/board/logicpd/am3517evm/am3517evm.h 
b/board/logicpd/am3517evm/am3517evm.h
index 704af84..d407d66 100644
--- a/board/logicpd/am3517evm/am3517evm.h
+++ b/board/logicpd/am3517evm/am3517evm.h
@@ -315,7 +315,7 @@ const omap3_sysinfo sysinfo = {
MUX_VAL(CP(SYS_CLKREQ), (IEN  | PTD | DIS | M0)) \
MUX_VAL(CP(SYS_NIRQ),   (IEN  | PTU | EN  | M0)) \
/*SYS_nRESWARM */\
-   MUX_VAL(CP(SYS_NRESWARM),   (IDIS | PTU | DIS | M4)) \
+   MUX_VAL(CP(SYS_NRESWARM),   (IDIS | PTU | EN | M4)) \
/* - GPIO30 */\
MUX_VAL(CP(SYS_BOOT0),  (IEN  | PTD | DIS | M4)) /*GPIO_2*/\
 /* - PEN_IRQ */\
-- 
1.7.7

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] am3517_evm: activate Ethernet PHY

2013-11-29 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Pin 30 is connected to PHY's RESET# signal, so it must be
put to high. Otherwize PHY won't be found via MDIO interface.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 board/logicpd/am3517evm/am3517evm.c |   34 ++
 board/logicpd/am3517evm/am3517evm.h |2 +-
 2 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/board/logicpd/am3517evm/am3517evm.c 
b/board/logicpd/am3517evm/am3517evm.c
index 1569905..80f7de0 100644
--- a/board/logicpd/am3517evm/am3517evm.c
+++ b/board/logicpd/am3517evm/am3517evm.c
@@ -22,6 +22,7 @@
 #include asm/arch/musb.h
 #include asm/mach-types.h
 #include asm/errno.h
+#include asm/gpio.h
 #include linux/usb/ch9.h
 #include linux/usb/gadget.h
 #include linux/usb/musb.h
@@ -31,6 +32,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define AM3517_IP_SW_RESET 0x48002598
+#define CPGMACSS_SW_RST(1  1)
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -98,6 +102,9 @@ static void am3517_evm_musb_init(void)
  */
 int misc_init_r(void)
 {
+   volatile unsigned int ctr;
+   u32 reset;
+
 #ifdef CONFIG_SYS_I2C_OMAP34XX
i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
 #endif
@@ -106,6 +113,33 @@ int misc_init_r(void)
 
am3517_evm_musb_init();
 
+#if defined(CONFIG_DRIVER_TI_EMAC)
+   /* activate PHY reset */
+   gpio_direction_output(30, 0);
+   gpio_set_value(30, 0);
+
+   ctr  = 0;
+   do {
+   udelay(1000);
+   ctr++;
+   } while (ctr  300);
+
+   /* deactivate PHY reset */
+   gpio_set_value(30, 1);
+
+   /* allow the PHY to stabilize and settle down */
+   ctr = 0;
+   do {
+   udelay(1000);
+   ctr++;
+   } while (ctr  300);
+
+   /* ensure that the module is out of reset */
+   reset = readl(AM3517_IP_SW_RESET);
+   reset = (~CPGMACSS_SW_RST);
+   writel(reset,AM3517_IP_SW_RESET);
+#endif
+
return 0;
 }
 
diff --git a/board/logicpd/am3517evm/am3517evm.h 
b/board/logicpd/am3517evm/am3517evm.h
index 704af84..d407d66 100644
--- a/board/logicpd/am3517evm/am3517evm.h
+++ b/board/logicpd/am3517evm/am3517evm.h
@@ -315,7 +315,7 @@ const omap3_sysinfo sysinfo = {
MUX_VAL(CP(SYS_CLKREQ), (IEN  | PTD | DIS | M0)) \
MUX_VAL(CP(SYS_NIRQ),   (IEN  | PTU | EN  | M0)) \
/*SYS_nRESWARM */\
-   MUX_VAL(CP(SYS_NRESWARM),   (IDIS | PTU | DIS | M4)) \
+   MUX_VAL(CP(SYS_NRESWARM),   (IDIS | PTU | EN | M4)) \
/* - GPIO30 */\
MUX_VAL(CP(SYS_BOOT0),  (IEN  | PTD | DIS | M4)) /*GPIO_2*/\
 /* - PEN_IRQ */\
-- 
1.7.7

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] net: add ICPlus PHY driver

2012-11-28 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

The driver code was taken from Linux kernel source:
drivers/net/phy/icplus.c

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 drivers/net/phy/Makefile |1 +
 drivers/net/phy/icplus.c |   90 ++
 drivers/net/phy/phy.c|3 ++
 3 files changed, 94 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/phy/icplus.c

diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index 5e90d70..2c5ab5f 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -34,6 +34,7 @@ COBJS-$(CONFIG_PHYLIB_10G) += generic_10g.o
 COBJS-$(CONFIG_PHY_ATHEROS) += atheros.o
 COBJS-$(CONFIG_PHY_BROADCOM) += broadcom.o
 COBJS-$(CONFIG_PHY_DAVICOM) += davicom.o
+COBJS-$(CONFIG_PHY_ICPLUS) += icplus.o
 COBJS-$(CONFIG_PHY_LXT) += lxt.o
 COBJS-$(CONFIG_PHY_MARVELL) += marvell.o
 COBJS-$(CONFIG_PHY_MICREL) += micrel.o
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c
new file mode 100644
index 000..85b9720
--- /dev/null
+++ b/drivers/net/phy/icplus.c
@@ -0,0 +1,90 @@
+/*
+ * ICPlus PHY drivers
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ *
+ */
+#include phy.h
+
+/* IP101A/G - IP1001 */
+#define IP10XX_SPEC_CTRL_STATUS 16  /* Spec. Control Register */
+#define IP1001_SPEC_CTRL_STATUS_2   20  /* IP1001 Spec. Control Reg 2 
*/
+#define IP1001_PHASE_SEL_MASK   3   /* IP1001 RX/TXPHASE_SEL */
+#define IP1001_APS_ON   11  /* IP1001 APS Mode  bit */
+#define IP101A_G_APS_ON 2   /* IP101A/G APS Mode bit */
+#define IP101A_G_IRQ_CONF_STATUS0x11/* Conf Info IRQ  Status Reg 
*/
+#define IP101A_G_IRQ_PIN_USED   (115) /* INTR pin used */
+#define IP101A_G_IRQ_DEFAULTIP101A_G_IRQ_PIN_USED
+
+static int ip1001_config(struct phy_device *phydev)
+{
+   int c;
+
+   /* Enable Auto Power Saving mode */
+   c = phy_read(phydev, MDIO_DEVAD_NONE,IP1001_SPEC_CTRL_STATUS_2);
+   if (c  0)
+   return c;
+   c |= IP1001_APS_ON;
+   c = phy_write(phydev, MDIO_DEVAD_NONE,IP1001_SPEC_CTRL_STATUS_2, c);
+   if (c  0)
+   return c;
+
+   /* INTR pin used: speed/link/duplex will cause an interrupt */
+   c = phy_write(phydev, MDIO_DEVAD_NONE,IP101A_G_IRQ_CONF_STATUS, 
IP101A_G_IRQ_DEFAULT);
+   if (c  0)
+   return c;
+
+   if (phydev-interface == PHY_INTERFACE_MODE_RGMII) {
+   /* Additional delay (2ns) used to adjust RX clock phase
+* at RGMII interface */
+   c = phy_read(phydev, MDIO_DEVAD_NONE,IP10XX_SPEC_CTRL_STATUS);
+   if (c  0)
+   return c;
+
+   c |= IP1001_PHASE_SEL_MASK;
+   c = phy_write(phydev, MDIO_DEVAD_NONE,IP10XX_SPEC_CTRL_STATUS, 
c);
+   if (c  0)
+   return c;
+   }
+
+   return 0;
+}
+
+static int ip1001_startup(struct phy_device *phydev)
+{
+   genphy_update_link(phydev);
+   genphy_parse_link(phydev);
+
+   return 0;
+}
+static struct phy_driver IP1001_driver = {
+   .name = ICPlus IP1001,
+   .uid = 0x02430d90,
+   .mask = 0x0ff0,
+   .features = PHY_GBIT_FEATURES,
+   .config = ip1001_config,
+   .startup = ip1001_startup,
+   .shutdown = genphy_shutdown,
+};
+
+int phy_icplus_init(void)
+{
+   phy_register(IP1001_driver);
+
+   return 0;
+}
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index c28ea70..9eccf40 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -429,6 +429,9 @@ int phy_init(void)
 #ifdef CONFIG_PHY_DAVICOM
phy_davicom_init();
 #endif
+#ifdef CONFIG_PHY_ICPLUS
+   phy_icplus_init();
+#endif
 #ifdef CONFIG_PHY_LXT
phy_lxt_init();
 #endif
-- 
1.7.7

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] phy: export genphy_parse_link()

2012-11-28 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 drivers/net/phy/phy.c |2 +-
 include/phy.h |1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 1ffa791..c28ea70 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -279,7 +279,7 @@ int genphy_update_link(struct phy_device *phydev)
  *
  * Stolen from Linux's mii.c and phy_device.c
  */
-static int genphy_parse_link(struct phy_device *phydev)
+int genphy_parse_link(struct phy_device *phydev)
 {
int mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR);
 
diff --git a/include/phy.h b/include/phy.h
index 3c30f11..1342ef7 100644
--- a/include/phy.h
+++ b/include/phy.h
@@ -209,6 +209,7 @@ int phy_register(struct phy_driver *drv);
 int genphy_config_aneg(struct phy_device *phydev);
 int genphy_restart_aneg(struct phy_device *phydev);
 int genphy_update_link(struct phy_device *phydev);
+int genphy_parse_link(struct phy_device *phydev);
 int genphy_config(struct phy_device *phydev);
 int genphy_startup(struct phy_device *phydev);
 int genphy_shutdown(struct phy_device *phydev);
-- 
1.7.7

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] am335x: disable internal delay for RGMII mode

2012-11-26 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

According to errata the AM335x device does not support internal delay
mode, so RGMII1_IDMODE and RGMII2_IDMODE must be set to 1.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 board/ti/am335x/board.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index b56a801..085bb9b 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -44,7 +44,7 @@ static struct uart_sys *uart_base = (struct uart_sys 
*)DEFAULT_UART_BASE;
 
 /* MII mode defines */
 #define MII_MODE_ENABLE0x0
-#define RGMII_MODE_ENABLE  0xA
+#define RGMII_MODE_ENABLE  0x3A
 
 /* GPIO that controls power to DDR on EVM-SK */
 #define GPIO_DDR_VTT_EN7
-- 
1.7.7

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] am335x: cpsw: make phy address configurable

2012-11-26 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 drivers/net/cpsw.c   |5 -
 include/configs/am335x_evm.h |1 +
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index af3d859..db04795 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -920,7 +920,10 @@ static int cpsw_phy_init(struct eth_device *dev, struct 
cpsw_slave *slave)
SUPPORTED_100baseT_Full |
SUPPORTED_1000baseT_Full);
 
-   phydev = phy_connect(priv-bus, 0, dev, slave-data-phy_if);
+   phydev = phy_connect(priv-bus,
+   CONFIG_PHY_ADDR,
+   dev,
+   slave-data-phy_if);
 
phydev-supported = supported;
phydev-advertising = phydev-supported;
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index b6e48f8..c49752e 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -272,6 +272,7 @@
 #define CONFIG_NET_MULTI
 #define CONFIG_PHY_GIGE
 #define CONFIG_PHYLIB
+#define CONFIG_PHY_ADDR0
 #define CONFIG_PHY_SMSC
 
 #endif /* ! __CONFIG_AM335X_EVM_H */
-- 
1.7.7

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot