mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-08-17 15:38:51 +09:00
Merge git://git.denx.de/u-boot-dm
This commit is contained in:
commit
8c20dc4074
@ -279,6 +279,11 @@
|
|||||||
0x38 8>;
|
0x38 8>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
timer {
|
||||||
|
compatible = "sandbox,timer";
|
||||||
|
clock-frequency = <1000000>;
|
||||||
|
};
|
||||||
|
|
||||||
uart0: serial {
|
uart0: serial {
|
||||||
compatible = "sandbox,serial";
|
compatible = "sandbox,serial";
|
||||||
u-boot,dm-pre-reloc;
|
u-boot,dm-pre-reloc;
|
||||||
|
@ -952,8 +952,7 @@ void fdt_del_node_and_alias(void *blob, const char *alias)
|
|||||||
/* Max address size we deal with */
|
/* Max address size we deal with */
|
||||||
#define OF_MAX_ADDR_CELLS 4
|
#define OF_MAX_ADDR_CELLS 4
|
||||||
#define OF_BAD_ADDR FDT_ADDR_T_NONE
|
#define OF_BAD_ADDR FDT_ADDR_T_NONE
|
||||||
#define OF_CHECK_COUNTS(na, ns) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \
|
#define OF_CHECK_COUNTS(na) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS)
|
||||||
(ns) > 0)
|
|
||||||
|
|
||||||
/* Debug utility */
|
/* Debug utility */
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -1121,7 +1120,7 @@ static u64 __of_translate_address(void *blob, int node_offset, const fdt32_t *in
|
|||||||
|
|
||||||
/* Cound address cells & copy address locally */
|
/* Cound address cells & copy address locally */
|
||||||
bus->count_cells(blob, parent, &na, &ns);
|
bus->count_cells(blob, parent, &na, &ns);
|
||||||
if (!OF_CHECK_COUNTS(na, ns)) {
|
if (!OF_CHECK_COUNTS(na)) {
|
||||||
printf("%s: Bad cell count for %s\n", __FUNCTION__,
|
printf("%s: Bad cell count for %s\n", __FUNCTION__,
|
||||||
fdt_get_name(blob, node_offset, NULL));
|
fdt_get_name(blob, node_offset, NULL));
|
||||||
goto bail;
|
goto bail;
|
||||||
@ -1148,7 +1147,7 @@ static u64 __of_translate_address(void *blob, int node_offset, const fdt32_t *in
|
|||||||
/* Get new parent bus and counts */
|
/* Get new parent bus and counts */
|
||||||
pbus = &of_busses[0];
|
pbus = &of_busses[0];
|
||||||
pbus->count_cells(blob, parent, &pna, &pns);
|
pbus->count_cells(blob, parent, &pna, &pns);
|
||||||
if (!OF_CHECK_COUNTS(pna, pns)) {
|
if (!OF_CHECK_COUNTS(pna)) {
|
||||||
printf("%s: Bad cell count for %s\n", __FUNCTION__,
|
printf("%s: Bad cell count for %s\n", __FUNCTION__,
|
||||||
fdt_get_name(blob, node_offset, NULL));
|
fdt_get_name(blob, node_offset, NULL));
|
||||||
break;
|
break;
|
||||||
|
@ -611,6 +611,41 @@ static int usb_kbd_probe(struct udevice *dev)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int usb_kbd_remove(struct udevice *dev)
|
||||||
|
{
|
||||||
|
struct usb_device *udev = dev_get_parent_priv(dev);
|
||||||
|
struct usb_kbd_pdata *data;
|
||||||
|
struct stdio_dev *sdev;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
sdev = stdio_get_by_name(DEVNAME);
|
||||||
|
if (!sdev) {
|
||||||
|
ret = -ENXIO;
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
data = udev->privptr;
|
||||||
|
if (stdio_deregister_dev(sdev, true)) {
|
||||||
|
ret = -EPERM;
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
#ifdef CONFIG_CONSOLE_MUX
|
||||||
|
if (iomux_doenv(stdin, getenv("stdin"))) {
|
||||||
|
ret = -ENOLINK;
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
|
||||||
|
destroy_int_queue(udev, data->intq);
|
||||||
|
#endif
|
||||||
|
free(data->new);
|
||||||
|
free(data);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
err:
|
||||||
|
printf("%s: warning, ret=%d", __func__, ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct udevice_id usb_kbd_ids[] = {
|
static const struct udevice_id usb_kbd_ids[] = {
|
||||||
{ .compatible = "usb-keyboard" },
|
{ .compatible = "usb-keyboard" },
|
||||||
{ }
|
{ }
|
||||||
@ -621,6 +656,7 @@ U_BOOT_DRIVER(usb_kbd) = {
|
|||||||
.id = UCLASS_KEYBOARD,
|
.id = UCLASS_KEYBOARD,
|
||||||
.of_match = usb_kbd_ids,
|
.of_match = usb_kbd_ids,
|
||||||
.probe = usb_kbd_probe,
|
.probe = usb_kbd_probe,
|
||||||
|
.remove = usb_kbd_remove,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct usb_device_id kbd_id_table[] = {
|
static const struct usb_device_id kbd_id_table[] = {
|
||||||
|
@ -65,7 +65,7 @@ static const unsigned char us_direction[256/8] = {
|
|||||||
static ccb usb_ccb __attribute__((aligned(ARCH_DMA_MINALIGN)));
|
static ccb usb_ccb __attribute__((aligned(ARCH_DMA_MINALIGN)));
|
||||||
static __u32 CBWTag;
|
static __u32 CBWTag;
|
||||||
|
|
||||||
#define USB_MAX_STOR_DEV 5
|
#define USB_MAX_STOR_DEV 7
|
||||||
static int usb_max_devs; /* number of highest available usb device */
|
static int usb_max_devs; /* number of highest available usb device */
|
||||||
|
|
||||||
static block_dev_desc_t usb_dev_desc[USB_MAX_STOR_DEV];
|
static block_dev_desc_t usb_dev_desc[USB_MAX_STOR_DEV];
|
||||||
|
@ -157,7 +157,7 @@ static int sb_eth_recv(struct udevice *dev, int flags, uchar **packetp)
|
|||||||
struct eth_sandbox_priv *priv = dev_get_priv(dev);
|
struct eth_sandbox_priv *priv = dev_get_priv(dev);
|
||||||
|
|
||||||
if (skip_timeout) {
|
if (skip_timeout) {
|
||||||
sandbox_timer_add_offset(10000UL);
|
sandbox_timer_add_offset(11000UL);
|
||||||
skip_timeout = false;
|
skip_timeout = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ int board_usb_cleanup(int index, enum usb_init_type init);
|
|||||||
|
|
||||||
#ifdef CONFIG_USB_STORAGE
|
#ifdef CONFIG_USB_STORAGE
|
||||||
|
|
||||||
#define USB_MAX_STOR_DEV 5
|
#define USB_MAX_STOR_DEV 7
|
||||||
block_dev_desc_t *usb_stor_get_dev(int index);
|
block_dev_desc_t *usb_stor_get_dev(int index);
|
||||||
int usb_stor_scan(int mode);
|
int usb_stor_scan(int mode);
|
||||||
int usb_stor_info(void);
|
int usb_stor_info(void);
|
||||||
|
29
net/eth.c
29
net/eth.c
@ -337,15 +337,31 @@ U_BOOT_ENV_CALLBACK(ethaddr, on_ethaddr);
|
|||||||
|
|
||||||
int eth_init(void)
|
int eth_init(void)
|
||||||
{
|
{
|
||||||
struct udevice *current;
|
char *ethact = getenv("ethact");
|
||||||
|
char *ethrotate = getenv("ethrotate");
|
||||||
|
struct udevice *current = NULL;
|
||||||
struct udevice *old_current;
|
struct udevice *old_current;
|
||||||
int ret = -ENODEV;
|
int ret = -ENODEV;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When 'ethrotate' variable is set to 'no' and 'ethact' variable
|
||||||
|
* is already set to an ethernet device, we should stick to 'ethact'.
|
||||||
|
*/
|
||||||
|
if ((ethrotate != NULL) && (strcmp(ethrotate, "no") == 0)) {
|
||||||
|
if (ethact) {
|
||||||
|
current = eth_get_dev_by_name(ethact);
|
||||||
|
if (!current)
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!current) {
|
||||||
current = eth_get_dev();
|
current = eth_get_dev();
|
||||||
if (!current) {
|
if (!current) {
|
||||||
printf("No ethernet found.\n");
|
printf("No ethernet found.\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
old_current = current;
|
old_current = current;
|
||||||
do {
|
do {
|
||||||
@ -1039,6 +1055,17 @@ int eth_receive(void *packet, int length)
|
|||||||
static void eth_current_changed(void)
|
static void eth_current_changed(void)
|
||||||
{
|
{
|
||||||
char *act = getenv("ethact");
|
char *act = getenv("ethact");
|
||||||
|
char *ethrotate;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The call to eth_get_dev() below has a side effect of rotating
|
||||||
|
* ethernet device if uc_priv->current == NULL. This is not what
|
||||||
|
* we want when 'ethrotate' variable is 'no'.
|
||||||
|
*/
|
||||||
|
ethrotate = getenv("ethrotate");
|
||||||
|
if ((ethrotate != NULL) && (strcmp(ethrotate, "no") == 0))
|
||||||
|
return;
|
||||||
|
|
||||||
/* update current ethernet name */
|
/* update current ethernet name */
|
||||||
if (eth_get_dev()) {
|
if (eth_get_dev()) {
|
||||||
if (act == NULL || strcmp(act, eth_get_name()) != 0)
|
if (act == NULL || strcmp(act, eth_get_name()) != 0)
|
||||||
|
@ -542,6 +542,9 @@ restart:
|
|||||||
#ifdef CONFIG_SHOW_ACTIVITY
|
#ifdef CONFIG_SHOW_ACTIVITY
|
||||||
show_activity(1);
|
show_activity(1);
|
||||||
#endif
|
#endif
|
||||||
|
if (arp_timeout_check() > 0)
|
||||||
|
time_start = get_timer(0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check the ethernet for a new packet. The ethernet
|
* Check the ethernet for a new packet. The ethernet
|
||||||
* receive routine will process it.
|
* receive routine will process it.
|
||||||
@ -570,10 +573,6 @@ restart:
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arp_timeout_check() > 0) {
|
|
||||||
time_start = get_timer(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for a timeout, and run the timeout handler
|
* Check for a timeout, and run the timeout handler
|
||||||
* if we have one.
|
* if we have one.
|
||||||
|
@ -27,8 +27,8 @@ obj-y += regmap.o
|
|||||||
obj-$(CONFIG_REMOTEPROC) += remoteproc.o
|
obj-$(CONFIG_REMOTEPROC) += remoteproc.o
|
||||||
obj-$(CONFIG_RESET) += reset.o
|
obj-$(CONFIG_RESET) += reset.o
|
||||||
obj-$(CONFIG_DM_RTC) += rtc.o
|
obj-$(CONFIG_DM_RTC) += rtc.o
|
||||||
obj-$(CONFIG_DM_SPI_FLASH) += sf.o
|
#obj-$(CONFIG_DM_SPI_FLASH) += sf.o
|
||||||
obj-$(CONFIG_DM_SPI) += spi.o
|
#obj-$(CONFIG_DM_SPI) += spi.o
|
||||||
obj-y += syscon.o
|
obj-y += syscon.o
|
||||||
obj-$(CONFIG_DM_USB) += usb.o
|
obj-$(CONFIG_DM_USB) += usb.o
|
||||||
obj-$(CONFIG_DM_PMIC) += pmic.o
|
obj-$(CONFIG_DM_PMIC) += pmic.o
|
||||||
|
Loading…
Reference in New Issue
Block a user