+// SPDX-License-Identifier: GPL-2.0+
/*
* K2G EVM : Board initialization
*
* (C) Copyright 2015
* Texas Instruments Incorporated, <www.ti.com>
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <asm/arch/clock.h>
#if defined(CONFIG_DTB_RESELECT)
static int k2g_alt_board_detect(void)
{
+#ifndef CONFIG_DM_I2C
int rc;
rc = i2c_set_bus_num(1);
rc = i2c_probe(K2G_GP_AUDIO_CODEC_ADDRESS);
if (rc)
return rc;
+#else
+ struct udevice *bus, *dev;
+ int rc;
+ rc = uclass_get_device_by_seq(UCLASS_I2C, 1, &bus);
+ if (rc)
+ return rc;
+ rc = dm_i2c_probe(bus, K2G_GP_AUDIO_CODEC_ADDRESS, 0, &dev);
+ if (rc)
+ return rc;
+#endif
ti_i2c_eeprom_am_set("66AK2GGP", "1.0X");
return 0;
}
#endif
-#ifdef CONFIG_DRIVER_TI_KEYSTONE_NET
-struct eth_priv_t eth_priv_cfg[] = {
- {
- .int_name = "K2G_EMAC",
- .rx_flow = 0,
- .phy_addr = 0,
- .slave_port = 1,
- .sgmii_link_type = SGMII_LINK_MAC_PHY,
- .phy_if = PHY_INTERFACE_MODE_RGMII,
- },
-};
-
-int get_num_eth_ports(void)
-{
- return sizeof(eth_priv_cfg) / sizeof(struct eth_priv_t);
-}
-#endif
-
#ifdef CONFIG_TI_SECURE_DEVICE
void board_pmmc_image_process(ulong pmmc_image, size_t pmmc_size)
{
- int id = getenv_ulong("dev_pmmc", 10, 0);
+ int id = env_get_ulong("dev_pmmc", 10, 0);
int ret;
if (!rproc_is_initialized())