- Clean vid/pid in Kconfig and add fastboot for rk3399
- add 'u-boot, spl-fifo-mode' for mmc
- Use FIT generator for rk3229 optee and rk3368 ATF
- fan53555: add support for Silergy SYR82X and SYR83X
This commit is contained in:
Tom Rini
2019-11-23 20:50:11 -05:00
36 changed files with 248 additions and 198 deletions

View File

@@ -64,7 +64,7 @@ config FASTBOOT_USB_DEV
config FASTBOOT_FLASH
bool "Enable FASTBOOT FLASH command"
default y if ARCH_SUNXI
default y if ARCH_SUNXI || ARCH_ROCKCHIP
depends on MMC || (NAND && CMD_MTDPARTS)
select IMAGE_SPARSE
help
@@ -89,6 +89,7 @@ endchoice
config FASTBOOT_FLASH_MMC_DEV
int "Define FASTBOOT MMC FLASH default device"
depends on FASTBOOT_FLASH_MMC
default 0 if ARCH_ROCKCHIP
default 0 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA = -1
default 1 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA != -1
help

View File

@@ -253,7 +253,6 @@ static int rk_i2c_read(struct rk_i2c *i2c, uchar chip, uint reg, uint r_len,
}
i2c_exit:
rk_i2c_send_stop_bit(i2c);
rk_i2c_disable(i2c);
return err;
@@ -332,7 +331,6 @@ static int rk_i2c_write(struct rk_i2c *i2c, uchar chip, uint reg, uint r_len,
}
i2c_exit:
rk_i2c_send_stop_bit(i2c);
rk_i2c_disable(i2c);
return err;
@@ -360,6 +358,9 @@ static int rockchip_i2c_xfer(struct udevice *bus, struct i2c_msg *msg,
}
}
rk_i2c_send_stop_bit(i2c);
rk_i2c_disable(i2c);
return 0;
}

View File

@@ -72,6 +72,11 @@ static int rockchip_dwmmc_ofdata_to_platdata(struct udevice *dev)
return -EINVAL;
priv->fifo_mode = dev_read_bool(dev, "fifo-mode");
#ifdef CONFIG_SPL_BUILD
if (!priv->fifo_mode)
priv->fifo_mode = dev_read_bool(dev, "u-boot,spl-fifo-mode");
#endif
/*
* 'clock-freq-min-max' is deprecated
* (see https://github.com/torvalds/linux/commit/b023030f10573de738bbe8df63d43acab64c9f7b)

View File

@@ -8,6 +8,7 @@
#include <dm/device-internal.h>
#include <dm/lists.h>
#include <i2c.h>
#include <power/fan53555.h>
#include <power/pmic.h>
#include <power/regulator.h>
@@ -58,7 +59,7 @@ static int pmic_fan53555_bind(struct udevice *dev)
return -ENOENT;
}
return device_bind_with_driver_data(dev, drv, "SW", 0,
return device_bind_with_driver_data(dev, drv, "SW", dev->driver_data,
dev_ofnode(dev), &child);
};
@@ -69,7 +70,9 @@ static struct dm_pmic_ops pmic_fan53555_ops = {
};
static const struct udevice_id pmic_fan53555_match[] = {
{ .compatible = "fcs,fan53555" },
{ .compatible = "fcs,fan53555", .data = FAN53555_VENDOR_FAIRCHILD, },
{ .compatible = "silergy,syr827", .data = FAN53555_VENDOR_SILERGY, },
{ .compatible = "silergy,syr828", .data = FAN53555_VENDOR_SILERGY, },
{ },
};

View File

@@ -10,6 +10,7 @@
#include <fdtdec.h>
#include <i2c.h>
#include <asm/gpio.h>
#include <power/fan53555.h>
#include <power/pmic.h>
#include <power/regulator.h>
@@ -27,21 +28,37 @@
* See http://www.onsemi.com/pub/Collateral/FAN53555-D.pdf for details.
*/
static const struct {
unsigned int vendor;
u8 die_id;
u8 die_rev;
bool check_rev;
u32 vsel_min;
u32 vsel_step;
} ic_types[] = {
{ 0x0, 0x3, 600000, 10000 }, /* Option 00 */
{ 0x0, 0xf, 800000, 10000 }, /* Option 13 */
{ 0x0, 0xc, 600000, 12500 }, /* Option 23 */
{ 0x1, 0x3, 600000, 10000 }, /* Option 01 */
{ 0x3, 0x3, 600000, 10000 }, /* Option 03 */
{ 0x4, 0xf, 603000, 12826 }, /* Option 04 */
{ 0x5, 0x3, 600000, 10000 }, /* Option 05 */
{ 0x8, 0x1, 600000, 10000 }, /* Option 08 */
{ 0x8, 0xf, 600000, 10000 }, /* Option 08 */
{ 0xc, 0xf, 603000, 12826 }, /* Option 09 */
/* Option 00 */
{ FAN53555_VENDOR_FAIRCHILD, 0x0, 0x3, true, 600000, 10000 },
/* Option 13 */
{ FAN53555_VENDOR_FAIRCHILD, 0x0, 0xf, true, 800000, 10000 },
/* Option 23 */
{ FAN53555_VENDOR_FAIRCHILD, 0x0, 0xc, true, 600000, 12500 },
/* Option 01 */
{ FAN53555_VENDOR_FAIRCHILD, 0x1, 0x3, true, 600000, 10000 },
/* Option 03 */
{ FAN53555_VENDOR_FAIRCHILD, 0x3, 0x3, true, 600000, 10000 },
/* Option 04 */
{ FAN53555_VENDOR_FAIRCHILD, 0x4, 0xf, true, 603000, 12826 },
/* Option 05 */
{ FAN53555_VENDOR_FAIRCHILD, 0x5, 0x3, true, 600000, 10000 },
/* Option 08 */
{ FAN53555_VENDOR_FAIRCHILD, 0x8, 0x1, true, 600000, 10000 },
/* Option 08 */
{ FAN53555_VENDOR_FAIRCHILD, 0x8, 0xf, true, 600000, 10000 },
/* Option 09 */
{ FAN53555_VENDOR_FAIRCHILD, 0xc, 0xf, true, 603000, 12826 },
/* SYL82X */
{ FAN53555_VENDOR_SILERGY, 0x8, 0x0, false, 712500, 12500 },
/* SYL83X */
{ FAN53555_VENDOR_SILERGY, 0x9, 0x0, false, 712500, 12500 },
};
/* I2C-accessible byte-sized registers */
@@ -142,7 +159,7 @@ static int fan53555_regulator_set_value(struct udevice *dev, int uV)
debug("%s: uV=%d; writing volume %d: %02x\n",
__func__, uV, pdata->vol_reg, vol);
return pmic_clrsetbits(dev, pdata->vol_reg, GENMASK(6, 0), vol);
return pmic_clrsetbits(dev->parent, pdata->vol_reg, GENMASK(6, 0), vol);
}
static int fan53555_voltages_setup(struct udevice *dev)
@@ -152,10 +169,14 @@ static int fan53555_voltages_setup(struct udevice *dev)
/* Init voltage range and step */
for (i = 0; i < ARRAY_SIZE(ic_types); ++i) {
if (ic_types[i].vendor != priv->vendor)
continue;
if (ic_types[i].die_id != priv->die_id)
continue;
if (ic_types[i].die_rev != priv->die_rev)
if (ic_types[i].check_rev &&
ic_types[i].die_rev != priv->die_rev)
continue;
priv->vsel_min = ic_types[i].vsel_min;
@@ -193,7 +214,7 @@ static int fan53555_probe(struct udevice *dev)
return ID2;
/* extract vendor, die_id and die_rev */
priv->vendor = bitfield_extract(ID1, 5, 3);
priv->vendor = dev->driver_data;
priv->die_id = ID1 & GENMASK(3, 0);
priv->die_rev = ID2 & GENMASK(3, 0);

View File

@@ -613,6 +613,31 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc)
dwc3_gadget_run(dwc);
}
static void dwc3_uboot_hsphy_mode(struct dwc3_device *dwc3_dev,
struct dwc3 *dwc)
{
enum usb_phy_interface hsphy_mode = dwc3_dev->hsphy_mode;
u32 reg;
/* Set dwc3 usb2 phy config */
reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
reg |= DWC3_GUSB2PHYCFG_PHYIF;
reg &= ~DWC3_GUSB2PHYCFG_USBTRDTIM_MASK;
switch (hsphy_mode) {
case USBPHY_INTERFACE_MODE_UTMI:
reg |= DWC3_GUSB2PHYCFG_USBTRDTIM_8BIT;
break;
case USBPHY_INTERFACE_MODE_UTMIW:
reg |= DWC3_GUSB2PHYCFG_USBTRDTIM_16BIT;
break;
default:
break;
}
dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
}
#define DWC3_ALIGN_MASK (16 - 1)
/**
@@ -721,6 +746,8 @@ int dwc3_uboot_init(struct dwc3_device *dwc3_dev)
goto err0;
}
dwc3_uboot_hsphy_mode(dwc3_dev, dwc);
ret = dwc3_event_buffers_setup(dwc);
if (ret) {
dev_err(dwc->dev, "failed to setup event buffers\n");

View File

@@ -162,6 +162,18 @@
/* Global USB2 PHY Configuration Register */
#define DWC3_GUSB2PHYCFG_PHYSOFTRST (1 << 31)
#define DWC3_GUSB2PHYCFG_SUSPHY (1 << 6)
#define DWC3_GUSB2PHYCFG_PHYIF BIT(3)
/* Global USB2 PHY Configuration Mask */
#define DWC3_GUSB2PHYCFG_USBTRDTIM_MASK (0xf << 10)
/* Global USB2 PHY Configuration Offset */
#define DWC3_GUSB2PHYCFG_USBTRDTIM_OFFSET 10
#define DWC3_GUSB2PHYCFG_USBTRDTIM_16BIT (0x5 << \
DWC3_GUSB2PHYCFG_USBTRDTIM_OFFSET)
#define DWC3_GUSB2PHYCFG_USBTRDTIM_8BIT (0x9 << \
DWC3_GUSB2PHYCFG_USBTRDTIM_OFFSET)
/* Global USB3 PIPE Control Register */
#define DWC3_GUSB3PIPECTL_PHYSOFTRST (1 << 31)

View File

@@ -39,6 +39,7 @@ if USB_GADGET
config USB_GADGET_MANUFACTURER
string "Vendor name of the USB device"
default "Allwinner Technology" if ARCH_SUNXI
default "Rockchip" if ARCH_ROCKCHIP
default "U-Boot"
help
Vendor name of the USB device emulated, reported to the host device.
@@ -47,6 +48,7 @@ config USB_GADGET_MANUFACTURER
config USB_GADGET_VENDOR_NUM
hex "Vendor ID of the USB device"
default 0x1f3a if ARCH_SUNXI
default 0x2207 if ARCH_ROCKCHIP
default 0x0
help
Vendor ID of the USB device emulated, reported to the host device.
@@ -56,6 +58,11 @@ config USB_GADGET_VENDOR_NUM
config USB_GADGET_PRODUCT_NUM
hex "Product ID of the USB device"
default 0x1010 if ARCH_SUNXI
default 0x310a if ROCKCHIP_RK3036
default 0x310c if ROCKCHIP_RK3128
default 0x320a if ROCKCHIP_RK3229 || ROCKCHIP_RK3288
default 0x330a if ROCKCHIP_RK3328
default 0x330c if ROCKCHIP_RK3399
default 0x0
help
Product ID of the USB device emulated, reported to the host device.