/{
pinctrl_0: pinctrl@11400000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
compatible = "samsung,exynos4210-pinctrl";
};
pinctrl_1: pinctrl@11000000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
gpx0: gpx0 {
- reg = <0xc00>;
+ reg = <0xc00 0x20>;
};
};
pinctrl_2: pinctrl@03860000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
};
};
/{
pinctrl_0: pinctrl@11400000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
gpf0: gpf0 {
- reg = <0x180>;
+ reg = <0x180 0x20>;
};
gpj0: gpj0 {
- reg = <0x240>;
+ reg = <0x240 0x20>;
};
};
pinctrl_1: pinctrl@11000000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
gpk0: gpk0 {
- reg = <0x40>;
+ reg = <0x40 0x20>;
};
gpm0: gpm0 {
- reg = <0x260>;
+ reg = <0x260 0x20>;
};
gpx0: gpx0 {
- reg = <0xc00>;
+ reg = <0xc00 0x20>;
};
};
pinctrl_2: pinctrl@03860000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
};
pinctrl_3: pinctrl@106E0000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
};
};
/{
pinctrl_0: pinctrl@11400000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
gpc4: gpc4 {
- reg = <0x2e0>;
+ reg = <0x2e0 0x20>;
};
gpx0: gpx0 {
- reg = <0xc00>;
+ reg = <0xc00 0x20>;
};
};
pinctrl_1: pinctrl@13400000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
};
pinctrl_2: pinctrl@10d10000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
gpv2: gpv2 {
- reg = <0x060>;
+ reg = <0x060 0x20>;
};
gpv4: gpv4 {
- reg = <0xc0>;
+ reg = <0xc0 0x20>;
};
};
pinctrl_3: pinctrl@03860000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
};
};
*/
pinctrl@14010000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
};
pinctrl@13400000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
gpy7 {
};
gpx0 {
- reg = <0xc00>;
+ reg = <0xc00 0x0>;
};
};
pinctrl@13410000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
};
pinctrl@14000000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
};
pinctrl@03860000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
};
};
/ {
pinctrl@e0200000 {
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
gpa0: gpa0 {
gpio-controller;
#gpio-cells = <2>;
};
gph0: gph0 {
- reg = <0xc00>;
+ reg = <0xc00 0x20>;
gpio-controller;
#gpio-cells = <2>;
};
#size-cells = <1>;
compatible = "n25q00", "spi-flash";
reg = <0>; /* chip select */
- spi-max-frequency = <50000000>;
+ spi-max-frequency = <100000000>;
m25p,fast-read;
page-size = <256>;
block-size = <16>; /* 2^16, 64KB */
#include <errno.h>
#include <i2c.h>
+#define DP501_I2C_ADDR 0x08
+
+#ifdef CONFIG_SYS_DP501_I2C
+int dp501_i2c[] = CONFIG_SYS_DP501_I2C;
+#endif
+
+#ifdef CONFIG_SYS_DP501_BASE
+int dp501_base[] = CONFIG_SYS_DP501_BASE;
+#endif
+
static void dp501_setbits(u8 addr, u8 reg, u8 mask)
{
u8 val;
{
dp501_setbits(addr, 0x0a, 0x30); /* power down encoder, standby mode */
}
+
+
+int dp501_probe(unsigned screen, bool power)
+{
+#ifdef CONFIG_SYS_DP501_BASE
+ uint8_t dp501_addr = dp501_base[screen];
+#else
+ uint8_t dp501_addr = DP501_I2C_ADDR;
+#endif
+
+#ifdef CONFIG_SYS_DP501_I2C
+ i2c_set_bus_num(dp501_i2c[screen]);
+#endif
+
+ if (i2c_probe(dp501_addr))
+ return -1;
+
+ dp501_powerup(dp501_addr);
+
+ return 0;
+}
void dp501_powerup(u8 addr);
void dp501_powerdown(u8 addr);
+int dp501_probe(unsigned screen, bool power);
#endif
#define SIL1178_MASTER_I2C_ADDRESS 0x38
#define SIL1178_SLAVE_I2C_ADDRESS 0x39
-#define DP501_I2C_ADDR 0x08
-
#define PIXCLK_640_480_60 25180000
#define MAX_X_CHARS 53
#define MAX_Y_CHARS 26
int sil1178_i2c[] = CONFIG_SYS_SIL1178_I2C;
#endif
-#ifdef CONFIG_SYS_DP501_I2C
-int dp501_i2c[] = CONFIG_SYS_DP501_I2C;
-#endif
-
-#ifdef CONFIG_SYS_DP501_BASE
-int dp501_base[] = CONFIG_SYS_DP501_BASE;
-#endif
-
#ifdef CONFIG_SYS_MPC92469AC
static void mpc92469ac_calc_parameters(unsigned int fout,
unsigned int *post_div, unsigned int *feedback_div)
int old_bus = i2c_get_bus_num();
bool pixclock_present = false;
bool output_driver_present = false;
-#ifdef CONFIG_SYS_DP501_I2C
-#ifdef CONFIG_SYS_DP501_BASE
- uint8_t dp501_addr = dp501_base[screen];
-#else
- uint8_t dp501_addr = DP501_I2C_ADDR;
-#endif
-#endif
OSD_GET_REG(0, version, &version);
OSD_GET_REG(0, features, &features);
#endif
#ifdef CONFIG_SYS_DP501_I2C
- i2c_set_bus_num(dp501_i2c[screen]);
- if (!i2c_probe(dp501_addr)) {
- dp501_powerup(dp501_addr);
+ if (!dp501_probe(screen, true))
output_driver_present = true;
- }
#endif
if (!output_driver_present)
#include "../common/adv7611.h"
#include "../common/ch7301.h"
+#include "../common/dp501.h"
#include "../common/ioep-fpga.h"
#include "../common/mclink.h"
#include "../common/osd.h"
int slaves;
unsigned int k;
unsigned int mux_ch;
- unsigned char mclink_controllers[] = { 0x3c, 0x3d, 0x3e };
+ unsigned char mclink_controllers_dvi[] = { 0x3c, 0x3d, 0x3e };
+#ifdef CONFIG_STRIDER_CPU
+ unsigned char mclink_controllers_dp[] = { 0x24, 0x25, 0x26 };
+#endif
bool hw_type_cat = pca9698_get_value(0x20, 18);
bool ch0_sgmii2_present = false;
pca9698_direction_output(0x20, 8, 0);
/* Turn on Parade DP501 */
- pca9698_direction_output(0x20, 9, 1);
+ pca9698_direction_output(0x20, 10, 1);
ch0_sgmii2_present = !pca9698_get_value(0x20, 37);
/* wait for FPGA done, then reset FPGA */
- for (k = 0; k < ARRAY_SIZE(mclink_controllers); ++k) {
+ for (k = 0; k < ARRAY_SIZE(mclink_controllers_dvi); ++k) {
unsigned int ctr = 0;
+ unsigned char *mclink_controllers = mclink_controllers_dvi;
+#ifdef CONFIG_STRIDER_CPU
+ if (i2c_probe(mclink_controllers[k])) {
+ mclink_controllers = mclink_controllers_dp;
+ if (i2c_probe(mclink_controllers[k]))
+ continue;
+ }
+#else
if (i2c_probe(mclink_controllers[k]))
continue;
-
+#endif
while (!(pca953x_get_val(mclink_controllers[k])
& MCFPGA_DONE)) {
udelay(100000);
#ifdef CONFIG_STRIDER_CPU
ch7301_probe(0, false);
+ dp501_probe(0, false);
#endif
if (slaves <= 0)
mclink_fpgacount = slaves;
+#ifdef CONFIG_STRIDER_CPU
+ /* get ADV7611 out of reset, power up DP501, give some time to wakeup */
+ for (k = 1; k <= slaves; ++k)
+ FPGA_SET_REG(k, extended_control, 0x10); /* enable video */
+
+ udelay(500000);
+#endif
+
for (k = 1; k <= slaves; ++k) {
ioep_fpga_print_info(k);
#ifdef CONFIG_STRIDER_CON
osd_probe(k);
#endif
#ifdef CONFIG_STRIDER_CPU
- FPGA_SET_REG(k, extended_control, 0); /* enable video in*/
if (!adv7611_probe(k))
printf(" Advantiv ADV7611 HDMI Receiver\n");
ch7301_probe(k, false);
+ dp501_probe(k, false);
#endif
if (hw_type_cat) {
miiphy_register(bb_miiphy_buses[k].name,
{
unsigned int gpio;
enum gpio_cmd sub_cmd;
- ulong value;
+ int value;
const char *str_cmd, *str_gpio = NULL;
int ret;
#ifdef CONFIG_DM_GPIO
value = gpio_get_value(gpio);
} else {
switch (sub_cmd) {
- case GPIO_SET: value = 1; break;
- case GPIO_CLEAR: value = 0; break;
- case GPIO_TOGGLE: value = !gpio_get_value(gpio); break;
- default: goto show_usage;
+ case GPIO_SET:
+ value = 1;
+ break;
+ case GPIO_CLEAR:
+ value = 0;
+ break;
+ case GPIO_TOGGLE:
+ value = gpio_get_value(gpio);
+ if (!IS_ERR_VALUE(value))
+ value = !value;
+ break;
+ default:
+ goto show_usage;
}
gpio_direction_output(gpio, value);
}
- printf("gpio: pin %s (gpio %i) value is %lu\n",
- str_gpio, gpio, value);
+ printf("gpio: pin %s (gpio %i) value is ", str_gpio, gpio);
+ if (IS_ERR_VALUE(value))
+ printf("unknown (ret=%d)\n", value);
+ else
+ printf("%d\n", value);
+ if (sub_cmd != GPIO_INPUT && !IS_ERR_VALUE(value)) {
+ int nval = gpio_get_value(gpio);
+
+ if (IS_ERR_VALUE(nval))
+ printf(" Warning: no access to GPIO output value\n");
+ else if (nval != value)
+ printf(" Warning: value of pin is still %d\n", nval);
+ }
if (ret != -EBUSY)
gpio_free(gpio);
/* Max address size we deal with */
#define OF_MAX_ADDR_CELLS 4
#define OF_BAD_ADDR FDT_ADDR_T_NONE
-#define OF_CHECK_COUNTS(na) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS)
+#define OF_CHECK_COUNTS(na, ns) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \
+ (ns) > 0)
/* Debug utility */
#ifdef DEBUG
/* Cound address cells & copy address locally */
bus->count_cells(blob, parent, &na, &ns);
- if (!OF_CHECK_COUNTS(na)) {
+ if (!OF_CHECK_COUNTS(na, ns)) {
printf("%s: Bad cell count for %s\n", __FUNCTION__,
fdt_get_name(blob, node_offset, NULL));
goto bail;
/* Get new parent bus and counts */
pbus = &of_busses[0];
pbus->count_cells(blob, parent, &pna, &pns);
- if (!OF_CHECK_COUNTS(pna)) {
+ if (!OF_CHECK_COUNTS(pna, pns)) {
printf("%s: Bad cell count for %s\n", __FUNCTION__,
fdt_get_name(blob, node_offset, NULL));
break;
static int usb_hub_port_reset(struct usb_device *dev, struct usb_device *hub)
{
- if (hub) {
- unsigned short portstatus;
- int err;
-
- /* reset the port for the second time */
- err = legacy_hub_port_reset(hub, dev->portnr - 1, &portstatus);
- if (err < 0) {
- printf("\n Couldn't reset port %i\n", dev->portnr);
- return err;
- }
- } else {
+ if (!hub)
usb_reset_root_port(dev);
- }
return 0;
}
#include <asm/processor.h>
#include <asm/unaligned.h>
#include <linux/ctype.h>
+#include <linux/list.h>
#include <asm/byteorder.h>
#ifdef CONFIG_SANDBOX
#include <asm/state.h>
#define USB_BUFSIZ 512
+#define HUB_SHORT_RESET_TIME 20
+#define HUB_LONG_RESET_TIME 200
+
+#define PORT_OVERCURRENT_MAX_SCAN_COUNT 3
+
+struct usb_device_scan {
+ struct usb_device *dev; /* USB hub device to scan */
+ struct usb_hub_device *hub; /* USB hub struct */
+ int port; /* USB port to scan */
+ struct list_head list;
+};
+
/* TODO(sjg@chromium.org): Remove this when CONFIG_DM_USB is defined */
static struct usb_hub_device hub_dev[USB_MAX_HUB];
static int usb_hub_index;
+static LIST_HEAD(usb_scan_list);
__weak void usb_hub_reset_devices(int port)
{
debug("port %d returns %lX\n", i + 1, dev->status);
}
+#ifdef CONFIG_SANDBOX
+ /*
+ * Don't set timeout / delay values here. This results
+ * in these values still being reset to 0.
+ */
+ if (state_get_skip_delays())
+ return;
+#endif
+
/*
* Wait for power to become stable,
* plus spec-defined max time for device to connect
pgood_delay = max(pgood_delay,
(unsigned)simple_strtol(env, NULL, 0));
debug("pgood_delay=%dms\n", pgood_delay);
- mdelay(pgood_delay + 1000);
+
+ /*
+ * Do a minimum delay of the larger value of 100ms or pgood_delay
+ * so that the power can stablize before the devices are queried
+ */
+ hub->query_delay = get_timer(0) + max(100, (int)pgood_delay);
+
+ /*
+ * Record the power-on timeout here. The max. delay (timeout)
+ * will be done based on this value in the USB port loop in
+ * usb_hub_configure() later.
+ */
+ hub->connect_timeout = hub->query_delay + 1000;
+ debug("devnum=%d poweron: query_delay=%d connect_timeout=%d\n",
+ dev->devnum, max(100, (int)pgood_delay),
+ max(100, (int)pgood_delay) + 1000);
}
void usb_hub_reset(void)
{
usb_hub_index = 0;
+
+ /* Zero out global hub_dev in case its re-used again */
+ memset(hub_dev, 0, sizeof(hub_dev));
}
static struct usb_hub_device *usb_hub_allocate(void)
int err, tries;
ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1);
unsigned short portstatus, portchange;
+ int delay = HUB_SHORT_RESET_TIME; /* start with short reset delay */
#ifdef CONFIG_DM_USB
debug("%s: resetting '%s' port %d...\n", __func__, dev->dev->name,
if (err < 0)
return err;
- mdelay(200);
+ mdelay(delay);
if (usb_get_port_status(dev, port + 1, portsts) < 0) {
debug("get_port_status failed status %lX\n",
if (portstatus & USB_PORT_STAT_ENABLE)
break;
- mdelay(200);
+ /* Switch to long reset delay for the next round */
+ delay = HUB_LONG_RESET_TIME;
}
if (tries == MAX_TRIES) {
if (!(portstatus & USB_PORT_STAT_CONNECTION))
return -ENOTCONN;
}
- mdelay(200);
/* Reset the port */
ret = legacy_hub_port_reset(dev, port, &portstatus);
return ret;
}
- mdelay(200);
-
switch (portstatus & USB_PORT_STAT_SPEED_MASK) {
case USB_PORT_STAT_SUPER_SPEED:
speed = USB_SPEED_SUPER;
return ret;
}
+static int usb_scan_port(struct usb_device_scan *usb_scan)
+{
+ ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1);
+ unsigned short portstatus;
+ unsigned short portchange;
+ struct usb_device *dev;
+ struct usb_hub_device *hub;
+ int ret = 0;
+ int i;
+
+ dev = usb_scan->dev;
+ hub = usb_scan->hub;
+ i = usb_scan->port;
+
+ /*
+ * Don't talk to the device before the query delay is expired.
+ * This is needed for voltages to stabalize.
+ */
+ if (get_timer(0) < hub->query_delay)
+ return 0;
+
+ ret = usb_get_port_status(dev, i + 1, portsts);
+ if (ret < 0) {
+ debug("get_port_status failed\n");
+ if (get_timer(0) >= hub->connect_timeout) {
+ debug("devnum=%d port=%d: timeout\n",
+ dev->devnum, i + 1);
+ /* Remove this device from scanning list */
+ list_del(&usb_scan->list);
+ free(usb_scan);
+ return 0;
+ }
+ }
+
+ portstatus = le16_to_cpu(portsts->wPortStatus);
+ portchange = le16_to_cpu(portsts->wPortChange);
+ debug("Port %d Status %X Change %X\n", i + 1, portstatus, portchange);
+
+ /* No connection change happened, wait a bit more. */
+ if (!(portchange & USB_PORT_STAT_C_CONNECTION)) {
+ if (get_timer(0) >= hub->connect_timeout) {
+ debug("devnum=%d port=%d: timeout\n",
+ dev->devnum, i + 1);
+ /* Remove this device from scanning list */
+ list_del(&usb_scan->list);
+ free(usb_scan);
+ return 0;
+ }
+ return 0;
+ }
+
+ /* Test if the connection came up, and if not exit */
+ if (!(portstatus & USB_PORT_STAT_CONNECTION))
+ return 0;
+
+ /* A new USB device is ready at this point */
+ debug("devnum=%d port=%d: USB dev found\n", dev->devnum, i + 1);
+
+ usb_hub_port_connect_change(dev, i);
+
+ if (portchange & USB_PORT_STAT_C_ENABLE) {
+ debug("port %d enable change, status %x\n", i + 1, portstatus);
+ usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_ENABLE);
+ /*
+ * The following hack causes a ghost device problem
+ * to Faraday EHCI
+ */
+#ifndef CONFIG_USB_EHCI_FARADAY
+ /*
+ * EM interference sometimes causes bad shielded USB
+ * devices to be shutdown by the hub, this hack enables
+ * them again. Works at least with mouse driver
+ */
+ if (!(portstatus & USB_PORT_STAT_ENABLE) &&
+ (portstatus & USB_PORT_STAT_CONNECTION) &&
+ usb_device_has_child_on_port(dev, i)) {
+ debug("already running port %i disabled by hub (EMI?), re-enabling...\n",
+ i + 1);
+ usb_hub_port_connect_change(dev, i);
+ }
+#endif
+ }
+
+ if (portstatus & USB_PORT_STAT_SUSPEND) {
+ debug("port %d suspend change\n", i + 1);
+ usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_SUSPEND);
+ }
+
+ if (portchange & USB_PORT_STAT_C_OVERCURRENT) {
+ debug("port %d over-current change\n", i + 1);
+ usb_clear_port_feature(dev, i + 1,
+ USB_PORT_FEAT_C_OVER_CURRENT);
+ /* Only power-on this one port */
+ usb_set_port_feature(dev, i + 1, USB_PORT_FEAT_POWER);
+ hub->overcurrent_count[i]++;
+
+ /*
+ * If the max-scan-count is not reached, return without removing
+ * the device from scan-list. This will re-issue a new scan.
+ */
+ if (hub->overcurrent_count[i] <=
+ PORT_OVERCURRENT_MAX_SCAN_COUNT)
+ return 0;
+
+ /* Otherwise the device will get removed */
+ printf("Port %d over-current occured %d times\n", i + 1,
+ hub->overcurrent_count[i]);
+ }
+
+ if (portchange & USB_PORT_STAT_C_RESET) {
+ debug("port %d reset change\n", i + 1);
+ usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_RESET);
+ }
+
+ /*
+ * We're done with this device, so let's remove this device from
+ * scanning list
+ */
+ list_del(&usb_scan->list);
+ free(usb_scan);
+
+ return 0;
+}
+
+static int usb_device_list_scan(void)
+{
+ struct usb_device_scan *usb_scan;
+ struct usb_device_scan *tmp;
+ static int running;
+ int ret = 0;
+
+ /* Only run this loop once for each controller */
+ if (running)
+ return 0;
+
+ running = 1;
+
+ while (1) {
+ /* We're done, once the list is empty again */
+ if (list_empty(&usb_scan_list))
+ goto out;
+
+ list_for_each_entry_safe(usb_scan, tmp, &usb_scan_list, list) {
+ int ret;
+
+ /* Scan this port */
+ ret = usb_scan_port(usb_scan);
+ if (ret)
+ goto out;
+ }
+ }
+
+out:
+ /*
+ * This USB controller has finished scanning all its connected
+ * USB devices. Set "running" back to 0, so that other USB controllers
+ * will scan their devices too.
+ */
+ running = 0;
+
+ return ret;
+}
static int usb_hub_configure(struct usb_device *dev)
{
for (i = 0; i < dev->maxchild; i++)
usb_hub_reset_devices(i + 1);
+ /*
+ * Only add the connected USB devices, including potential hubs,
+ * to a scanning list. This list will get scanned and devices that
+ * are detected (either via port connected or via port timeout)
+ * will get removed from this list. Scanning of the devices on this
+ * list will continue until all devices are removed.
+ */
for (i = 0; i < dev->maxchild; i++) {
- ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1);
- unsigned short portstatus, portchange;
- int ret;
- ulong start = get_timer(0);
- uint delay = CONFIG_SYS_HZ;
-
-#ifdef CONFIG_SANDBOX
- if (state_get_skip_delays())
- delay = 0;
-#endif
-#ifdef CONFIG_DM_USB
- debug("\n\nScanning '%s' port %d\n", dev->dev->name, i + 1);
-#else
- debug("\n\nScanning port %d\n", i + 1);
-#endif
- /*
- * Wait for (whichever finishes first)
- * - A maximum of 10 seconds
- * This is a purely observational value driven by connecting
- * a few broken pen drives and taking the max * 1.5 approach
- * - connection_change and connection state to report same
- * state
- */
- do {
- ret = usb_get_port_status(dev, i + 1, portsts);
- if (ret < 0) {
- debug("get_port_status failed\n");
- break;
- }
-
- portstatus = le16_to_cpu(portsts->wPortStatus);
- portchange = le16_to_cpu(portsts->wPortChange);
-
- /* No connection change happened, wait a bit more. */
- if (!(portchange & USB_PORT_STAT_C_CONNECTION))
- continue;
-
- /* Test if the connection came up, and if so, exit. */
- if (portstatus & USB_PORT_STAT_CONNECTION)
- break;
-
- } while (get_timer(start) < delay);
-
- if (ret < 0)
- continue;
+ struct usb_device_scan *usb_scan;
- debug("Port %d Status %X Change %X\n",
- i + 1, portstatus, portchange);
-
- if (portchange & USB_PORT_STAT_C_CONNECTION) {
- debug("port %d connection change\n", i + 1);
- usb_hub_port_connect_change(dev, i);
- }
- if (portchange & USB_PORT_STAT_C_ENABLE) {
- debug("port %d enable change, status %x\n",
- i + 1, portstatus);
- usb_clear_port_feature(dev, i + 1,
- USB_PORT_FEAT_C_ENABLE);
- /*
- * The following hack causes a ghost device problem
- * to Faraday EHCI
- */
-#ifndef CONFIG_USB_EHCI_FARADAY
- /* EM interference sometimes causes bad shielded USB
- * devices to be shutdown by the hub, this hack enables
- * them again. Works at least with mouse driver */
- if (!(portstatus & USB_PORT_STAT_ENABLE) &&
- (portstatus & USB_PORT_STAT_CONNECTION) &&
- usb_device_has_child_on_port(dev, i)) {
- debug("already running port %i " \
- "disabled by hub (EMI?), " \
- "re-enabling...\n", i + 1);
- usb_hub_port_connect_change(dev, i);
- }
-#endif
- }
- if (portstatus & USB_PORT_STAT_SUSPEND) {
- debug("port %d suspend change\n", i + 1);
- usb_clear_port_feature(dev, i + 1,
- USB_PORT_FEAT_SUSPEND);
- }
-
- if (portchange & USB_PORT_STAT_C_OVERCURRENT) {
- debug("port %d over-current change\n", i + 1);
- usb_clear_port_feature(dev, i + 1,
- USB_PORT_FEAT_C_OVER_CURRENT);
- usb_hub_power_on(hub);
+ usb_scan = calloc(1, sizeof(*usb_scan));
+ if (!usb_scan) {
+ printf("Can't allocate memory for USB device!\n");
+ return -ENOMEM;
}
+ usb_scan->dev = dev;
+ usb_scan->hub = hub;
+ usb_scan->port = i;
+ list_add_tail(&usb_scan->list, &usb_scan_list);
+ }
- if (portchange & USB_PORT_STAT_C_RESET) {
- debug("port %d reset change\n", i + 1);
- usb_clear_port_feature(dev, i + 1,
- USB_PORT_FEAT_C_RESET);
- }
- } /* end for i all ports */
+ /*
+ * And now call the scanning code which loops over the generated list
+ */
+ ret = usb_device_list_scan();
- return 0;
+ return ret;
}
static int usb_hub_check(struct usb_device *dev, int ifnum)
CONFIG_DEVRES=y
CONFIG_ADC=y
CONFIG_ADC_SANDBOX=y
+CONFIG_BLK=y
CONFIG_CLK=y
CONFIG_SANDBOX_GPIO=y
CONFIG_SYS_I2C_SANDBOX=y
CONFIG_DWAPB_GPIO=y
CONFIG_DM_MMC=y
CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_STMICRO=y
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
CONFIG_DM_ETH=y
CONFIG_ETH_DESIGNWARE=y
CONFIG_SYS_NS16550=y
+CONFIG_CADENCE_QSPI=y
DECLARE_GLOBAL_DATA_PTR;
-#ifndef CONFIG_BLK
-static struct host_block_dev host_devices[CONFIG_HOST_MAX_DEVICES];
-
-static struct host_block_dev *find_host_device(int dev)
-{
- if (dev >= 0 && dev < CONFIG_HOST_MAX_DEVICES)
- return &host_devices[dev];
-
- return NULL;
-}
-#endif
-
-#ifdef CONFIG_BLK
static unsigned long host_block_read(struct udevice *dev,
unsigned long start, lbaint_t blkcnt,
void *buffer)
struct host_block_dev *host_dev = dev_get_priv(dev);
struct blk_desc *block_dev = dev_get_uclass_platdata(dev);
-#else
-static unsigned long host_block_read(struct blk_desc *block_dev,
- unsigned long start, lbaint_t blkcnt,
- void *buffer)
-{
- int dev = block_dev->devnum;
- struct host_block_dev *host_dev = find_host_device(dev);
-
- if (!host_dev)
- return -1;
-#endif
-
if (os_lseek(host_dev->fd, start * block_dev->blksz, OS_SEEK_SET) ==
-1) {
printf("ERROR: Invalid block %lx\n", start);
return -1;
}
-#ifdef CONFIG_BLK
static unsigned long host_block_write(struct udevice *dev,
unsigned long start, lbaint_t blkcnt,
const void *buffer)
{
struct host_block_dev *host_dev = dev_get_priv(dev);
struct blk_desc *block_dev = dev_get_uclass_platdata(dev);
-#else
-static unsigned long host_block_write(struct blk_desc *block_dev,
- unsigned long start, lbaint_t blkcnt,
- const void *buffer)
-{
- int dev = block_dev->devnum;
- struct host_block_dev *host_dev = find_host_device(dev);
-#endif
if (os_lseek(host_dev->fd, start * block_dev->blksz, OS_SEEK_SET) ==
-1) {
return -1;
}
-#ifdef CONFIG_BLK
int host_dev_bind(int devnum, char *filename)
{
struct host_block_dev *host_dev;
free(str);
return ret;
}
-#else
-int host_dev_bind(int dev, char *filename)
-{
- struct host_block_dev *host_dev = find_host_device(dev);
-
- if (!host_dev)
- return -1;
- if (host_dev->blk_dev.priv) {
- os_close(host_dev->fd);
- host_dev->blk_dev.priv = NULL;
- }
- if (host_dev->filename)
- free(host_dev->filename);
- if (filename && *filename) {
- host_dev->filename = strdup(filename);
- } else {
- host_dev->filename = NULL;
- return 0;
- }
-
- host_dev->fd = os_open(host_dev->filename, OS_O_RDWR);
- if (host_dev->fd == -1) {
- printf("Failed to access host backing file '%s'\n",
- host_dev->filename);
- return 1;
- }
-
- struct blk_desc *blk_dev = &host_dev->blk_dev;
- blk_dev->if_type = IF_TYPE_HOST;
- blk_dev->priv = host_dev;
- blk_dev->blksz = 512;
- blk_dev->lba = os_lseek(host_dev->fd, 0, OS_SEEK_END) / blk_dev->blksz;
- blk_dev->block_read = host_block_read;
- blk_dev->block_write = host_block_write;
- blk_dev->devnum = dev;
- blk_dev->part_type = PART_TYPE_UNKNOWN;
- part_init(blk_dev);
-
- return 0;
-}
-#endif
int host_get_dev_err(int devnum, struct blk_desc **blk_devp)
{
-#ifdef CONFIG_BLK
struct udevice *dev;
int ret;
if (ret)
return ret;
*blk_devp = dev_get_uclass_platdata(dev);
-#else
- struct host_block_dev *host_dev = find_host_device(devnum);
-
- if (!host_dev)
- return -ENODEV;
-
- if (!host_dev->blk_dev.priv)
- return -ENOENT;
-
- *blk_devp = &host_dev->blk_dev;
-#endif
return 0;
}
return blk_dev;
}
-#ifdef CONFIG_BLK
static const struct blk_ops sandbox_host_blk_ops = {
.read = host_block_read,
.write = host_block_write,
.ops = &sandbox_host_blk_ops,
.priv_auto_alloc_size = sizeof(struct host_block_dev),
};
-#endif
* As far as we know it doesn't make sense to support selection of
* these options at run-time, so use the existing CONFIG options.
*/
- serial_out_shift(addr, plat->reg_shift, value);
+ serial_out_shift(addr + plat->reg_offset, plat->reg_shift, value);
}
static int ns16550_readb(NS16550_t port, int offset)
offset *= 1 << plat->reg_shift;
addr = map_physmem(plat->base, 0, MAP_NOCACHE) + offset;
- return serial_in_shift(addr, plat->reg_shift);
+ return serial_in_shift(addr + plat->reg_offset, plat->reg_shift);
}
/* We can clean these up once everything is moved to driver model */
return -EINVAL;
plat->base = addr;
+ plat->reg_offset = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
+ "reg-offset", 0);
plat->reg_shift = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
"reg-shift", 0);
plat->clock = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
if (ret && !err)
err = ret;
}
-
+#ifdef CONFIG_BLK
+ ret = blk_unbind_all(IF_TYPE_USB);
+ if (ret && !err)
+ err = ret;
+#endif
#ifdef CONFIG_SANDBOX
struct udevice *dev;
if (usb_pipedevice(pipe) == ctrl->rootdev)
return xhci_submit_root(udev, pipe, buffer, setup);
- if (setup->request == USB_REQ_SET_ADDRESS)
+ if (setup->request == USB_REQ_SET_ADDRESS &&
+ (setup->requesttype & USB_TYPE_MASK) == USB_TYPE_STANDARD)
return xhci_address_device(udev, root_portnr);
- if (setup->request == USB_REQ_SET_CONFIGURATION) {
+ if (setup->request == USB_REQ_SET_CONFIGURATION &&
+ (setup->requesttype & USB_TYPE_MASK) == USB_TYPE_STANDARD) {
ret = xhci_set_configuration(udev);
if (ret) {
puts("Failed to configure xHCI endpoint\n");
#define CONFIG_SYS_CONSOLE_IS_IN_ENV
#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
#define CONFIG_SYS_CONSOLE_ENV_OVERWRITE
+#if !defined(CONFIG_ENV_SIZE)
#define CONFIG_ENV_SIZE 4096
+#endif
/* Environment for SDMMC boot */
#if defined(CONFIG_ENV_IS_IN_MMC) && !defined(CONFIG_ENV_OFFSET)
#define CONFIG_ENV_OFFSET 512 /* just after the MBR */
#endif
+/* Environment for QSPI boot */
+#if defined(CONFIG_ENV_IS_IN_SPI_FLASH) && !defined(CONFIG_ENV_OFFSET)
+#define CONFIG_ENV_OFFSET 0x00100000
+#define CONFIG_ENV_SECT_SIZE (64 * 1024)
+#endif
+
/*
* mtd partitioning for serial NOR flash
*
#define CONFIG_SYS_BOOTCOUNT_ADDR 0xfffffff8
#define CONFIG_SYS_BOOTCOUNT_BE
-/* The rest of the configuration is shared */
-#include <configs/socfpga_common.h>
-
-/* U-Boot payload is stored at offset 0x60000 */
-#undef CONFIG_SYS_SPI_U_BOOT_OFFS
-#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x60000
-
/* Environment setting for SPI flash */
-#undef CONFIG_ENV_SIZE
#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
#define CONFIG_ENV_SECT_SIZE (64 * 1024)
#define CONFIG_ENV_SIZE (16 * 1024)
-#define CONFIG_ENV_OFFSET 0x00040000
+#define CONFIG_ENV_OFFSET 0x000e0000
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SECT_SIZE)
#define CONFIG_ENV_SPI_BUS 0
#define CONFIG_ENV_SPI_CS 0
#define CONFIG_ENV_SPI_MODE SPI_MODE_3
-#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
+#define CONFIG_ENV_SPI_MAX_HZ 100000000 /* Use max of 100MHz */
+#define CONFIG_SF_DEFAULT_SPEED 100000000
+
+/*
+ * The QSPI NOR flash layout on SR1500:
+ *
+ * 0000.0000 - 0003.ffff: SPL (4 times)
+ * 0004.0000 - 000d.ffff: U-Boot
+ * 000e.0000 - 000e.ffff: env1
+ * 000f.0000 - 000f.ffff: env2
+ */
+
+/* The rest of the configuration is shared */
+#include <configs/socfpga_common.h>
#endif /* __CONFIG_SOCFPGA_SR1500_H__ */
| BR_PS_16 /* 16 bit port */ \
| BR_MS_GPCM /* MSEL = GPCM */ \
| BR_V) /* valid */
-#define CONFIG_SYS_OR1_PRELIM (MEG_TO_AM(CONFIG_SYS_FPGA0_SIZE) \
+
+#define CONFIG_SYS_OR1_PRELIM (MEG_TO_AM(CONFIG_SYS_FPGA0_SIZE) \
| OR_UPM_XAM \
| OR_GPCM_CSNT \
- | OR_GPCM_ACS_DIV2 \
- | OR_GPCM_XACS \
- | OR_GPCM_SCY_15 \
- | OR_GPCM_TRLX_SET \
- | OR_GPCM_EHTR_SET)
+ | OR_GPCM_SCY_5 \
+ | OR_GPCM_TRLX_CLEAR \
+ | OR_GPCM_EHTR_CLEAR)
#define CONFIG_SYS_FPGA_BASE(k) CONFIG_SYS_FPGA0_BASE
#define CONFIG_SYS_FPGA_DONE(k) 0x0010
#define CONFIG_SYS_FSL_I2C_OFFSET 0x3000
#define CONFIG_PCA953X /* NXP PCA9554 */
+#define CONFIG_CMD_PCA953X
+#define CONFIG_CMD_PCA953X_INFO
+#define CONFIG_SYS_I2C_PCA953X_WIDTH { {0x24, 16}, {0x25, 16}, {0x26, 16}, \
+ {0x3c, 8}, {0x3d, 8}, {0x3e, 8} }
+
#define CONFIG_PCA9698 /* NXP PCA9698 */
#define CONFIG_SYS_I2C_IHS
unsigned long base;
int reg_shift;
int clock;
+ int reg_offset;
};
struct udevice;
struct usb_hub_device {
struct usb_device *pusb_dev;
struct usb_hub_descriptor desc;
+
+ ulong connect_timeout; /* Device connection timeout in ms */
+ ulong query_delay; /* Device query delay in ms */
+ int overcurrent_count[USB_MAXCHILDREN]; /* Over-current counter */
};
#ifdef CONFIG_DM_USB
# subsystem you must add sandbox tests here.
obj-$(CONFIG_UT_DM) += core.o
ifneq ($(CONFIG_SANDBOX),)
+obj-$(CONFIG_BLK) += blk.o
obj-$(CONFIG_CLK) += clk.o
obj-$(CONFIG_DM_ETH) += eth.o
obj-$(CONFIG_DM_GPIO) += gpio.o
--- /dev/null
+/*
+ * Copyright (C) 2015 Google, Inc
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <usb.h>
+#include <asm/state.h>
+#include <dm/test.h>
+#include <test/ut.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* Test that block devices can be created */
+static int dm_test_blk_base(struct unit_test_state *uts)
+{
+ struct udevice *blk, *usb_blk, *dev;
+
+ /* Make sure there are no block devices */
+ ut_asserteq(-ENODEV, uclass_get_device_by_seq(UCLASS_BLK, 0, &blk));
+
+ /* Create two, one the parent of the other */
+ ut_assertok(blk_create_device(gd->dm_root, "sandbox_host_blk", "test",
+ IF_TYPE_HOST, 1, 512, 1024, &blk));
+ ut_assertok(blk_create_device(blk, "usb_storage_blk", "test",
+ IF_TYPE_USB, 3, 512, 1024, &usb_blk));
+
+ /* Check we can find them */
+ ut_asserteq(-ENODEV, blk_get_device(IF_TYPE_HOST, 0, &dev));
+ ut_assertok(blk_get_device(IF_TYPE_HOST, 1, &dev));
+ ut_asserteq_ptr(blk, dev);
+
+ ut_asserteq(-ENODEV, blk_get_device(IF_TYPE_USB, 0, &dev));
+ ut_assertok(blk_get_device(IF_TYPE_USB, 3, &dev));
+ ut_asserteq_ptr(usb_blk, dev);
+
+ /* Check we can iterate */
+ ut_assertok(blk_first_device(IF_TYPE_HOST, &dev));
+ ut_asserteq_ptr(blk, dev);
+ ut_asserteq(-ENODEV, blk_next_device(&dev));
+
+ ut_assertok(blk_first_device(IF_TYPE_USB, &dev));
+ ut_asserteq_ptr(usb_blk, dev);
+ ut_asserteq(-ENODEV, blk_next_device(&dev));
+
+ return 0;
+}
+DM_TEST(dm_test_blk_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+static int count_blk_devices(void)
+{
+ struct udevice *blk;
+ struct uclass *uc;
+ int count = 0;
+ int ret;
+
+ ret = uclass_get(UCLASS_BLK, &uc);
+ if (ret)
+ return ret;
+
+ uclass_foreach_dev(blk, uc)
+ count++;
+
+ return count;
+}
+
+/* Test that block devices work correctly with USB */
+static int dm_test_blk_usb(struct unit_test_state *uts)
+{
+ struct udevice *usb_dev, *dev;
+ struct blk_desc *dev_desc;
+
+ /* Get a flash device */
+ state_set_skip_delays(true);
+ ut_assertok(usb_init());
+ ut_assertok(uclass_get_device(UCLASS_MASS_STORAGE, 0, &usb_dev));
+ ut_assertok(blk_get_device_by_str("usb", "0", &dev_desc));
+
+ /* The parent should be a block device */
+ ut_assertok(blk_get_device(IF_TYPE_USB, 0, &dev));
+ ut_asserteq_ptr(usb_dev, dev_get_parent(dev));
+
+ /* Check we have one block device for each mass storage device */
+ ut_asserteq(3, count_blk_devices());
+
+ /* Now go around again, making sure the old devices were unbound */
+ ut_assertok(usb_stop());
+ ut_assertok(usb_init());
+ ut_asserteq(3, count_blk_devices());
+ ut_assertok(usb_stop());
+
+ return 0;
+}
+DM_TEST(dm_test_blk_usb, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
The toolchain-alias section indicates that the i386 toolchain should be used
to build x86 commits.
+Note that you can also specific exactly toolchain prefixes if you like:
+
+[toolchain-prefix]
+arm: /opt/arm-eabi-4.6/bin/arm-eabi-
+
+or even:
+
+[toolchain-prefix]
+arm: /opt/arm-eabi-4.6/bin/arm-eabi-gcc
+
+This tells buildman that you want to use this exact toolchain for the arm
+architecture. This will override any toolchains found by searching using the
+[toolchain] settings.
+
+Since the toolchain prefix is an explicit request, buildman will report an
+error if a toolchain is not found with that prefix. The current PATH will be
+searched, so it is possible to use:
+
+[toolchain-prefix]
+arm: arm-none-eabi-
+
+and buildman will find arm-none-eabi-gcc in /usr/bin if you have it installed.
3. Make sure you have the require Python pre-requisites
$ ./tools/buildman/buildman --list-tool-chains
Scanning for tool chains
+ - scanning prefix '/opt/gcc-4.6.3-nolibc/x86_64-linux/bin/x86_64-linux-'
+Tool chain test: OK, arch='x86', priority 1
+ - scanning prefix '/opt/arm-eabi-4.6/bin/arm-eabi-'
+Tool chain test: OK, arch='arm', priority 1
+ - scanning path '/toolchains/gcc-4.9.0-nolibc/i386-linux'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/i386-linux/.'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/i386-linux/bin'
+ - found '/toolchains/gcc-4.9.0-nolibc/i386-linux/bin/i386-linux-gcc'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/i386-linux/usr/bin'
+Tool chain test: OK, arch='i386', priority 4
+ - scanning path '/toolchains/gcc-4.9.0-nolibc/aarch64-linux'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/aarch64-linux/.'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/aarch64-linux/bin'
+ - found '/toolchains/gcc-4.9.0-nolibc/aarch64-linux/bin/aarch64-linux-gcc'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/aarch64-linux/usr/bin'
+Tool chain test: OK, arch='aarch64', priority 4
+ - scanning path '/toolchains/gcc-4.9.0-nolibc/microblaze-linux'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/microblaze-linux/.'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/microblaze-linux/bin'
+ - found '/toolchains/gcc-4.9.0-nolibc/microblaze-linux/bin/microblaze-linux-gcc'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/microblaze-linux/usr/bin'
+Tool chain test: OK, arch='microblaze', priority 4
+ - scanning path '/toolchains/gcc-4.9.0-nolibc/mips64-linux'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/mips64-linux/.'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/mips64-linux/bin'
+ - found '/toolchains/gcc-4.9.0-nolibc/mips64-linux/bin/mips64-linux-gcc'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/mips64-linux/usr/bin'
+Tool chain test: OK, arch='mips64', priority 4
+ - scanning path '/toolchains/gcc-4.9.0-nolibc/sparc64-linux'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/sparc64-linux/.'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/sparc64-linux/bin'
+ - found '/toolchains/gcc-4.9.0-nolibc/sparc64-linux/bin/sparc64-linux-gcc'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/sparc64-linux/usr/bin'
+Tool chain test: OK, arch='sparc64', priority 4
+ - scanning path '/toolchains/gcc-4.9.0-nolibc/arm-unknown-linux-gnueabi'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/arm-unknown-linux-gnueabi/.'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/arm-unknown-linux-gnueabi/bin'
+ - found '/toolchains/gcc-4.9.0-nolibc/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/arm-unknown-linux-gnueabi/usr/bin'
+Tool chain test: OK, arch='arm', priority 3
+Toolchain '/toolchains/gcc-4.9.0-nolibc/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc' at priority 3 will be ignored because another toolchain for arch 'arm' has priority 1
+ - scanning path '/toolchains/gcc-4.9.0-nolibc/sparc-linux'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/sparc-linux/.'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/sparc-linux/bin'
+ - found '/toolchains/gcc-4.9.0-nolibc/sparc-linux/bin/sparc-linux-gcc'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/sparc-linux/usr/bin'
+Tool chain test: OK, arch='sparc', priority 4
+ - scanning path '/toolchains/gcc-4.9.0-nolibc/mips-linux'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/mips-linux/.'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/mips-linux/bin'
+ - found '/toolchains/gcc-4.9.0-nolibc/mips-linux/bin/mips-linux-gcc'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/mips-linux/usr/bin'
+Tool chain test: OK, arch='mips', priority 4
+ - scanning path '/toolchains/gcc-4.9.0-nolibc/x86_64-linux'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/x86_64-linux/.'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin'
+ - found '/toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-gcc'
+ - found '/toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-x86_64-linux-gcc'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/x86_64-linux/usr/bin'
+Tool chain test: OK, arch='x86_64', priority 4
+Tool chain test: OK, arch='x86_64', priority 4
+Toolchain '/toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-x86_64-linux-gcc' at priority 4 will be ignored because another toolchain for arch 'x86_64' has priority 4
+ - scanning path '/toolchains/gcc-4.9.0-nolibc/m68k-linux'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/m68k-linux/.'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/m68k-linux/bin'
+ - found '/toolchains/gcc-4.9.0-nolibc/m68k-linux/bin/m68k-linux-gcc'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/m68k-linux/usr/bin'
+Tool chain test: OK, arch='m68k', priority 4
+ - scanning path '/toolchains/gcc-4.9.0-nolibc/powerpc-linux'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/powerpc-linux/.'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/powerpc-linux/bin'
+ - found '/toolchains/gcc-4.9.0-nolibc/powerpc-linux/bin/powerpc-linux-gcc'
+ - looking in '/toolchains/gcc-4.9.0-nolibc/powerpc-linux/usr/bin'
+Tool chain test: OK, arch='powerpc', priority 4
+ - scanning path '/toolchains/gcc-4.6.3-nolibc/bfin-uclinux'
+ - looking in '/toolchains/gcc-4.6.3-nolibc/bfin-uclinux/.'
+ - looking in '/toolchains/gcc-4.6.3-nolibc/bfin-uclinux/bin'
+ - found '/toolchains/gcc-4.6.3-nolibc/bfin-uclinux/bin/bfin-uclinux-gcc'
+ - looking in '/toolchains/gcc-4.6.3-nolibc/bfin-uclinux/usr/bin'
+Tool chain test: OK, arch='bfin', priority 6
+ - scanning path '/toolchains/gcc-4.6.3-nolibc/sparc-linux'
+ - looking in '/toolchains/gcc-4.6.3-nolibc/sparc-linux/.'
+ - looking in '/toolchains/gcc-4.6.3-nolibc/sparc-linux/bin'
+ - found '/toolchains/gcc-4.6.3-nolibc/sparc-linux/bin/sparc-linux-gcc'
+ - looking in '/toolchains/gcc-4.6.3-nolibc/sparc-linux/usr/bin'
+Tool chain test: OK, arch='sparc', priority 4
+Toolchain '/toolchains/gcc-4.6.3-nolibc/sparc-linux/bin/sparc-linux-gcc' at priority 4 will be ignored because another toolchain for arch 'sparc' has priority 4
+ - scanning path '/toolchains/gcc-4.6.3-nolibc/mips-linux'
+ - looking in '/toolchains/gcc-4.6.3-nolibc/mips-linux/.'
+ - looking in '/toolchains/gcc-4.6.3-nolibc/mips-linux/bin'
+ - found '/toolchains/gcc-4.6.3-nolibc/mips-linux/bin/mips-linux-gcc'
+ - looking in '/toolchains/gcc-4.6.3-nolibc/mips-linux/usr/bin'
+Tool chain test: OK, arch='mips', priority 4
+Toolchain '/toolchains/gcc-4.6.3-nolibc/mips-linux/bin/mips-linux-gcc' at priority 4 will be ignored because another toolchain for arch 'mips' has priority 4
+ - scanning path '/toolchains/gcc-4.6.3-nolibc/m68k-linux'
+ - looking in '/toolchains/gcc-4.6.3-nolibc/m68k-linux/.'
+ - looking in '/toolchains/gcc-4.6.3-nolibc/m68k-linux/bin'
+ - found '/toolchains/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux-gcc'
+ - looking in '/toolchains/gcc-4.6.3-nolibc/m68k-linux/usr/bin'
+Tool chain test: OK, arch='m68k', priority 4
+Toolchain '/toolchains/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux-gcc' at priority 4 will be ignored because another toolchain for arch 'm68k' has priority 4
+ - scanning path '/toolchains/gcc-4.6.3-nolibc/powerpc-linux'
+ - looking in '/toolchains/gcc-4.6.3-nolibc/powerpc-linux/.'
+ - looking in '/toolchains/gcc-4.6.3-nolibc/powerpc-linux/bin'
+ - found '/toolchains/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-gcc'
+ - looking in '/toolchains/gcc-4.6.3-nolibc/powerpc-linux/usr/bin'
+Tool chain test: OK, arch='powerpc', priority 4
+Tool chain test: OK, arch='or32', priority 4
+ - scanning path '/toolchains/gcc-4.2.4-nolibc/avr32-linux'
+ - looking in '/toolchains/gcc-4.2.4-nolibc/avr32-linux/.'
+ - looking in '/toolchains/gcc-4.2.4-nolibc/avr32-linux/bin'
+ - found '/toolchains/gcc-4.2.4-nolibc/avr32-linux/bin/avr32-linux-gcc'
+ - looking in '/toolchains/gcc-4.2.4-nolibc/avr32-linux/usr/bin'
+Tool chain test: OK, arch='avr32', priority 4
- scanning path '/'
- looking in '/.'
- looking in '/bin'
- looking in '/usr/bin'
- - found '/usr/bin/gcc'
-Tool chain test: OK
+ - found '/usr/bin/i586-mingw32msvc-gcc'
- found '/usr/bin/c89-gcc'
-Tool chain test: OK
- - found '/usr/bin/c99-gcc'
-Tool chain test: OK
- found '/usr/bin/x86_64-linux-gnu-gcc'
-Tool chain test: OK
- - scanning path '/toolchains/powerpc-linux'
- - looking in '/toolchains/powerpc-linux/.'
- - looking in '/toolchains/powerpc-linux/bin'
- - found '/toolchains/powerpc-linux/bin/powerpc-linux-gcc'
-Tool chain test: OK
- - looking in '/toolchains/powerpc-linux/usr/bin'
- - scanning path '/toolchains/nds32le-linux-glibc-v1f'
- - looking in '/toolchains/nds32le-linux-glibc-v1f/.'
- - looking in '/toolchains/nds32le-linux-glibc-v1f/bin'
- - found '/toolchains/nds32le-linux-glibc-v1f/bin/nds32le-linux-gcc'
-Tool chain test: OK
- - looking in '/toolchains/nds32le-linux-glibc-v1f/usr/bin'
- - scanning path '/toolchains/nios2'
- - looking in '/toolchains/nios2/.'
- - looking in '/toolchains/nios2/bin'
- - found '/toolchains/nios2/bin/nios2-linux-gcc'
-Tool chain test: OK
- - found '/toolchains/nios2/bin/nios2-linux-uclibc-gcc'
-Tool chain test: OK
- - looking in '/toolchains/nios2/usr/bin'
- - found '/toolchains/nios2/usr/bin/nios2-linux-gcc'
-Tool chain test: OK
- - found '/toolchains/nios2/usr/bin/nios2-linux-uclibc-gcc'
-Tool chain test: OK
- - scanning path '/toolchains/microblaze-unknown-linux-gnu'
- - looking in '/toolchains/microblaze-unknown-linux-gnu/.'
- - looking in '/toolchains/microblaze-unknown-linux-gnu/bin'
- - found '/toolchains/microblaze-unknown-linux-gnu/bin/microblaze-unknown-linux-gnu-gcc'
-Tool chain test: OK
- - found '/toolchains/microblaze-unknown-linux-gnu/bin/mb-linux-gcc'
-Tool chain test: OK
- - looking in '/toolchains/microblaze-unknown-linux-gnu/usr/bin'
- - scanning path '/toolchains/mips-linux'
- - looking in '/toolchains/mips-linux/.'
- - looking in '/toolchains/mips-linux/bin'
- - found '/toolchains/mips-linux/bin/mips-linux-gcc'
-Tool chain test: OK
- - looking in '/toolchains/mips-linux/usr/bin'
- - scanning path '/toolchains/old'
- - looking in '/toolchains/old/.'
- - looking in '/toolchains/old/bin'
- - looking in '/toolchains/old/usr/bin'
- - scanning path '/toolchains/i386-linux'
- - looking in '/toolchains/i386-linux/.'
- - looking in '/toolchains/i386-linux/bin'
- - found '/toolchains/i386-linux/bin/i386-linux-gcc'
-Tool chain test: OK
- - looking in '/toolchains/i386-linux/usr/bin'
- - scanning path '/toolchains/bfin-uclinux'
- - looking in '/toolchains/bfin-uclinux/.'
- - looking in '/toolchains/bfin-uclinux/bin'
- - found '/toolchains/bfin-uclinux/bin/bfin-uclinux-gcc'
-Tool chain test: OK
- - looking in '/toolchains/bfin-uclinux/usr/bin'
- - scanning path '/toolchains/sparc-elf'
- - looking in '/toolchains/sparc-elf/.'
- - looking in '/toolchains/sparc-elf/bin'
- - found '/toolchains/sparc-elf/bin/sparc-elf-gcc'
-Tool chain test: OK
- - looking in '/toolchains/sparc-elf/usr/bin'
- - scanning path '/toolchains/arm-2010q1'
- - looking in '/toolchains/arm-2010q1/.'
- - looking in '/toolchains/arm-2010q1/bin'
- - found '/toolchains/arm-2010q1/bin/arm-none-linux-gnueabi-gcc'
-Tool chain test: OK
- - looking in '/toolchains/arm-2010q1/usr/bin'
- - scanning path '/toolchains/from'
- - looking in '/toolchains/from/.'
- - looking in '/toolchains/from/bin'
- - looking in '/toolchains/from/usr/bin'
- - scanning path '/toolchains/sh4-gentoo-linux-gnu'
- - looking in '/toolchains/sh4-gentoo-linux-gnu/.'
- - looking in '/toolchains/sh4-gentoo-linux-gnu/bin'
- - found '/toolchains/sh4-gentoo-linux-gnu/bin/sh4-gentoo-linux-gnu-gcc'
-Tool chain test: OK
- - looking in '/toolchains/sh4-gentoo-linux-gnu/usr/bin'
- - scanning path '/toolchains/avr32-linux'
- - looking in '/toolchains/avr32-linux/.'
- - looking in '/toolchains/avr32-linux/bin'
- - found '/toolchains/avr32-linux/bin/avr32-gcc'
-Tool chain test: OK
- - looking in '/toolchains/avr32-linux/usr/bin'
- - scanning path '/toolchains/m68k-linux'
- - looking in '/toolchains/m68k-linux/.'
- - looking in '/toolchains/m68k-linux/bin'
- - found '/toolchains/m68k-linux/bin/m68k-linux-gcc'
-Tool chain test: OK
- - looking in '/toolchains/m68k-linux/usr/bin'
-List of available toolchains (17):
-arm : /toolchains/arm-2010q1/bin/arm-none-linux-gnueabi-gcc
-avr32 : /toolchains/avr32-linux/bin/avr32-gcc
-bfin : /toolchains/bfin-uclinux/bin/bfin-uclinux-gcc
+ - found '/usr/bin/gcc'
+ - found '/usr/bin/c99-gcc'
+ - found '/usr/bin/arm-linux-gnueabi-gcc'
+ - found '/usr/bin/aarch64-linux-gnu-gcc'
+ - found '/usr/bin/winegcc'
+ - found '/usr/bin/arm-linux-gnueabihf-gcc'
+Tool chain test: OK, arch='i586', priority 11
+Tool chain test: OK, arch='c89', priority 11
+Tool chain test: OK, arch='x86_64', priority 4
+Toolchain '/usr/bin/x86_64-linux-gnu-gcc' at priority 4 will be ignored because another toolchain for arch 'x86_64' has priority 4
+Tool chain test: OK, arch='sandbox', priority 11
+Tool chain test: OK, arch='c99', priority 11
+Tool chain test: OK, arch='arm', priority 4
+Toolchain '/usr/bin/arm-linux-gnueabi-gcc' at priority 4 will be ignored because another toolchain for arch 'arm' has priority 1
+Tool chain test: OK, arch='aarch64', priority 4
+Toolchain '/usr/bin/aarch64-linux-gnu-gcc' at priority 4 will be ignored because another toolchain for arch 'aarch64' has priority 4
+Tool chain test: OK, arch='sandbox', priority 11
+Toolchain '/usr/bin/winegcc' at priority 11 will be ignored because another toolchain for arch 'sandbox' has priority 11
+Tool chain test: OK, arch='arm', priority 4
+Toolchain '/usr/bin/arm-linux-gnueabihf-gcc' at priority 4 will be ignored because another toolchain for arch 'arm' has priority 1
+List of available toolchains (34):
+aarch64 : /toolchains/gcc-4.9.0-nolibc/aarch64-linux/bin/aarch64-linux-gcc
+alpha : /toolchains/gcc-4.9.0-nolibc/alpha-linux/bin/alpha-linux-gcc
+am33_2.0 : /toolchains/gcc-4.9.0-nolibc/am33_2.0-linux/bin/am33_2.0-linux-gcc
+arm : /opt/arm-eabi-4.6/bin/arm-eabi-gcc
+avr32 : /toolchains/gcc-4.2.4-nolibc/avr32-linux/bin/avr32-linux-gcc
+bfin : /toolchains/gcc-4.6.3-nolibc/bfin-uclinux/bin/bfin-uclinux-gcc
c89 : /usr/bin/c89-gcc
c99 : /usr/bin/c99-gcc
-i386 : /toolchains/i386-linux/bin/i386-linux-gcc
-m68k : /toolchains/m68k-linux/bin/m68k-linux-gcc
-mb : /toolchains/microblaze-unknown-linux-gnu/bin/mb-linux-gcc
-microblaze: /toolchains/microblaze-unknown-linux-gnu/bin/microblaze-unknown-linux-gnu-gcc
-mips : /toolchains/mips-linux/bin/mips-linux-gcc
-nds32le : /toolchains/nds32le-linux-glibc-v1f/bin/nds32le-linux-gcc
-nios2 : /toolchains/nios2/bin/nios2-linux-gcc
-powerpc : /toolchains/powerpc-linux/bin/powerpc-linux-gcc
+frv : /toolchains/gcc-4.9.0-nolibc/frv-linux/bin/frv-linux-gcc
+h8300 : /toolchains/gcc-4.9.0-nolibc/h8300-elf/bin/h8300-elf-gcc
+hppa : /toolchains/gcc-4.9.0-nolibc/hppa-linux/bin/hppa-linux-gcc
+hppa64 : /toolchains/gcc-4.9.0-nolibc/hppa64-linux/bin/hppa64-linux-gcc
+i386 : /toolchains/gcc-4.9.0-nolibc/i386-linux/bin/i386-linux-gcc
+i586 : /usr/bin/i586-mingw32msvc-gcc
+ia64 : /toolchains/gcc-4.9.0-nolibc/ia64-linux/bin/ia64-linux-gcc
+m32r : /toolchains/gcc-4.9.0-nolibc/m32r-linux/bin/m32r-linux-gcc
+m68k : /toolchains/gcc-4.9.0-nolibc/m68k-linux/bin/m68k-linux-gcc
+microblaze: /toolchains/gcc-4.9.0-nolibc/microblaze-linux/bin/microblaze-linux-gcc
+mips : /toolchains/gcc-4.9.0-nolibc/mips-linux/bin/mips-linux-gcc
+mips64 : /toolchains/gcc-4.9.0-nolibc/mips64-linux/bin/mips64-linux-gcc
+or32 : /toolchains/gcc-4.5.1-nolibc/or32-linux/bin/or32-linux-gcc
+powerpc : /toolchains/gcc-4.9.0-nolibc/powerpc-linux/bin/powerpc-linux-gcc
+powerpc64 : /toolchains/gcc-4.9.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc
+ppc64le : /toolchains/gcc-4.9.0-nolibc/ppc64le-linux/bin/ppc64le-linux-gcc
+s390x : /toolchains/gcc-4.9.0-nolibc/s390x-linux/bin/s390x-linux-gcc
sandbox : /usr/bin/gcc
-sh4 : /toolchains/sh4-gentoo-linux-gnu/bin/sh4-gentoo-linux-gnu-gcc
-sparc : /toolchains/sparc-elf/bin/sparc-elf-gcc
-x86_64 : /usr/bin/x86_64-linux-gnu-gcc
+sh4 : /toolchains/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux-gcc
+sparc : /toolchains/gcc-4.9.0-nolibc/sparc-linux/bin/sparc-linux-gcc
+sparc64 : /toolchains/gcc-4.9.0-nolibc/sparc64-linux/bin/sparc64-linux-gcc
+tilegx : /toolchains/gcc-4.6.2-nolibc/tilegx-linux/bin/tilegx-linux-gcc
+x86 : /opt/gcc-4.6.3-nolibc/x86_64-linux/bin/x86_64-linux-gcc
+x86_64 : /toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-gcc
You can see that everything is covered, even some strange ones that won't
err: Output from stderr, if any. Errors and warnings appear here.
log: Output from stdout. Normally there isn't any since buildman runs
- in silent mode for now.
+ in silent mode. Use -V to force a verbose build (this passes V=1
+ to 'make')
toolchain: Shows information about the toolchain used for the build.
parser.add_option('-v', '--verbose', action='store_true',
default=False, help='Show build results while the build progresses')
parser.add_option('-V', '--verbose-build', action='store_true',
- default=False, help='Run make with V=1, showing all output')
+ default=False, help='Run make with V=1, logging all output')
parser.add_option('-x', '--exclude', dest='exclude',
type='string', action='append',
help='Specify a list of boards to exclude, separated by comma')
self.assertEqual(gitutil.use_no_decorate, True)
def _HandleCommandGitLog(self, args):
+ if args[-1] == '--':
+ args = args[:-1]
if '-n0' in args:
return command.CommandResult(return_code=0)
elif args[-1] == 'upstream/master..%s' % self._test_branch:
import bsettings
import command
-PRIORITY_CALC = 0
+(PRIORITY_FULL_PREFIX, PRIORITY_PREFIX_GCC, PRIORITY_PREFIX_GCC_PATH,
+ PRIORITY_CALC) = range(4)
# Simple class to collect links from a page
class MyHTMLParser(HTMLParser):
Public members:
toolchains: Dict of Toolchain objects, keyed by architecture name
+ prefixes: Dict of prefixes to check, keyed by architecture. This can
+ be a full path and toolchain prefix, for example
+ {'x86', 'opt/i386-linux/bin/i386-linux-'}, or the name of
+ something on the search path, for example
+ {'arm', 'arm-linux-gnueabihf-'}. Wildcards are not supported.
paths: List of paths to check for toolchains (may contain wildcards)
"""
def __init__(self):
self.toolchains = {}
+ self.prefixes = {}
self.paths = []
self._make_flags = dict(bsettings.GetItems('make-flags'))
return paths
def GetSettings(self):
+ self.prefixes = bsettings.GetItems('toolchain-prefix')
self.paths += self.GetPathList()
def Add(self, fname, test=True, verbose=False, priority=PRIORITY_CALC,
fnames.append(fname)
return fnames
+ def ScanPathEnv(self, fname):
+ """Scan the PATH environment variable for a given filename.
+
+ Args:
+ fname: Filename to scan for
+ Returns:
+ List of matching pathanames, or [] if none
+ """
+ pathname_list = []
+ for path in os.environ["PATH"].split(os.pathsep):
+ path = path.strip('"')
+ pathname = os.path.join(path, fname)
+ if os.path.exists(pathname):
+ pathname_list.append(pathname)
+ return pathname_list
def Scan(self, verbose):
"""Scan for available toolchains and select the best for each arch.
verbose: True to print out progress information
"""
if verbose: print 'Scanning for tool chains'
+ for name, value in self.prefixes:
+ if verbose: print " - scanning prefix '%s'" % value
+ if os.path.exists(value):
+ self.Add(value, True, verbose, PRIORITY_FULL_PREFIX, name)
+ continue
+ fname = value + 'gcc'
+ if os.path.exists(fname):
+ self.Add(fname, True, verbose, PRIORITY_PREFIX_GCC, name)
+ continue
+ fname_list = self.ScanPathEnv(fname)
+ for f in fname_list:
+ self.Add(f, True, verbose, PRIORITY_PREFIX_GCC_PATH, name)
+ if not fname_list:
+ raise ValueError, ("No tool chain found for prefix '%s'" %
+ value)
for path in self.paths:
if verbose: print " - scanning path '%s'" % path
fnames = self.ScanPath(path, verbose)
cmd.append('-n%d' % count)
if commit_range:
cmd.append(commit_range)
+
+ # Add this in case we have a branch with the same name as a directory.
+ # This avoids messages like this, for example:
+ # fatal: ambiguous argument 'test': both revision and filename
+ cmd.append('--')
return cmd
def CountCommitsToBranch():