summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-08-03 22:45:13 +0200
committerWolfgang Denk <wd@denx.de>2010-08-03 22:45:13 +0200
commitac956293befb265b8958654d08c4ad52e605d46e (patch)
tree4fbfc08b1be8616bc5ee2032b53996ac0c5d64d8 /drivers
parente9aecdec153ae166739858e6a570432449b979f7 (diff)
parent7385c28e9b5f7d47e6a8f1ad9800e6e70af714e2 (diff)
Merge branch 'master' of /home/wd/git/u-boot/master
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/pca953x.c3
-rw-r--r--drivers/i2c/soft_i2c.c52
-rw-r--r--drivers/misc/ds4510.c13
-rw-r--r--drivers/misc/fsl_law.c3
-rw-r--r--drivers/misc/fsl_pmic.c20
-rw-r--r--drivers/pci/fsl_pci_init.c15
-rw-r--r--drivers/qe/qe.c9
-rw-r--r--drivers/video/cfb_console.c6
8 files changed, 85 insertions, 36 deletions
diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c
index d1065f4f8e..6e82bd66af 100644
--- a/drivers/gpio/pca953x.c
+++ b/drivers/gpio/pca953x.c
@@ -164,8 +164,7 @@ int do_pca953x(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (!c || !((argc == (c->maxargs)) ||
(((int)c->cmd == PCA953X_CMD_DEVICE) &&
(argc == (c->maxargs - 1))))) {
- cmd_usage(cmdtp);
- return 1;
+ return cmd_usage(cmdtp);
}
/* arg2 used as chip number or pin number */
diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
index e0cf1e10db..1a1809ac16 100644
--- a/drivers/i2c/soft_i2c.c
+++ b/drivers/i2c/soft_i2c.c
@@ -51,6 +51,58 @@
#endif
#include <i2c.h>
+#if defined(CONFIG_SOFT_I2C_GPIO_SCL)
+# include <asm/gpio.h>
+
+# ifndef I2C_GPIO_SYNC
+# define I2C_GPIO_SYNC
+# endif
+
+# ifndef I2C_INIT
+# define I2C_INIT \
+ do { \
+ gpio_request(CONFIG_SOFT_I2C_GPIO_SCL, "soft_i2c"); \
+ gpio_request(CONFIG_SOFT_I2C_GPIO_SDA, "soft_i2c"); \
+ } while (0)
+# endif
+
+# ifndef I2C_ACTIVE
+# define I2C_ACTIVE do { } while (0)
+# endif
+
+# ifndef I2C_TRISTATE
+# define I2C_TRISTATE do { } while (0)
+# endif
+
+# ifndef I2C_READ
+# define I2C_READ gpio_get_value(CONFIG_SOFT_I2C_GPIO_SDA)
+# endif
+
+# ifndef I2C_SDA
+# define I2C_SDA(bit) \
+ do { \
+ if (bit) \
+ gpio_direction_input(CONFIG_SOFT_I2C_GPIO_SDA); \
+ else \
+ gpio_direction_output(CONFIG_SOFT_I2C_GPIO_SDA, 0); \
+ I2C_GPIO_SYNC; \
+ } while (0)
+# endif
+
+# ifndef I2C_SCL
+# define I2C_SCL(bit) \
+ do { \
+ gpio_direction_output(CONFIG_SOFT_I2C_GPIO_SCL, bit); \
+ I2C_GPIO_SYNC; \
+ } while (0)
+# endif
+
+# ifndef I2C_DELAY
+# define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
+# endif
+
+#endif
+
/* #define DEBUG_I2C */
#ifdef DEBUG_I2C
diff --git a/drivers/misc/ds4510.c b/drivers/misc/ds4510.c
index 5b33c1ffce..aa893c35fb 100644
--- a/drivers/misc/ds4510.c
+++ b/drivers/misc/ds4510.c
@@ -294,8 +294,7 @@ int do_ds4510(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (!c || !((argc == (c->maxargs)) ||
(((int)c->cmd == DS4510_CMD_DEVICE) &&
(argc == (c->maxargs - 1))))) {
- cmd_usage(cmdtp);
- return 1;
+ return cmd_usage(cmdtp);
}
/* arg2 used as chip addr and pin number */
@@ -366,14 +365,12 @@ int do_ds4510(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#ifdef CONFIG_CMD_DS4510_MEM
/* Only eeprom, seeprom, and sram commands should make it here */
- if (strcmp(argv[2], "read") == 0) {
+ if (strcmp(argv[2], "read") == 0)
rw_func = ds4510_mem_read;
- } else if (strcmp(argv[2], "write") == 0) {
+ else if (strcmp(argv[2], "write") == 0)
rw_func = ds4510_mem_write;
- } else {
- cmd_usage(cmdtp);
- return 1;
- }
+ else
+ return cmd_usage(cmdtp);
addr = simple_strtoul(argv[3], NULL, 16);
off += simple_strtoul(argv[4], NULL, 16);
diff --git a/drivers/misc/fsl_law.c b/drivers/misc/fsl_law.c
index 628bd5964c..65890769ac 100644
--- a/drivers/misc/fsl_law.c
+++ b/drivers/misc/fsl_law.c
@@ -43,7 +43,8 @@ DECLARE_GLOBAL_DATA_PTR;
defined(CONFIG_P1013) || defined(CONFIG_P1022) || \
defined(CONFIG_P2010) || defined(CONFIG_P2020)
#define FSL_HW_NUM_LAWS 12
-#elif defined(CONFIG_PPC_P4080)
+#elif defined(CONFIG_PPC_P3041) || defined(CONFIG_PPC_P4080) || \
+ defined(CONFIG_PPC_P5020)
#define FSL_HW_NUM_LAWS 32
#else
#error FSL_HW_NUM_LAWS not defined for this platform
diff --git a/drivers/misc/fsl_pmic.c b/drivers/misc/fsl_pmic.c
index 274327f470..dca0a1d57e 100644
--- a/drivers/misc/fsl_pmic.c
+++ b/drivers/misc/fsl_pmic.c
@@ -163,26 +163,22 @@ int do_pmic(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
u32 val;
/* at least two arguments please */
- if (argc < 2) {
- cmd_usage(cmdtp);
- return 1;
- }
+ if (argc < 2)
+ return cmd_usage(cmdtp);
cmd = argv[1];
if (strcmp(cmd, "dump") == 0) {
- if (argc < 3) {
- cmd_usage(cmdtp);
- return 1;
- }
+ if (argc < 3)
+ return cmd_usage(cmdtp);
+
nregs = simple_strtoul(argv[2], NULL, 16);
pmic_dump(nregs);
return 0;
}
if (strcmp(cmd, "write") == 0) {
- if (argc < 4) {
- cmd_usage(cmdtp);
- return 1;
- }
+ if (argc < 4)
+ return cmd_usage(cmdtp);
+
nregs = simple_strtoul(argv[2], NULL, 16);
val = simple_strtoul(argv[3], NULL, 16);
pmic_reg_write(nregs, val);
diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c
index 5a63fa2168..001e6eb900 100644
--- a/drivers/pci/fsl_pci_init.c
+++ b/drivers/pci/fsl_pci_init.c
@@ -510,18 +510,25 @@ void fsl_pci_config_unlock(struct pci_controller *hose)
#include <libfdt.h>
#include <fdt_support.h>
-void ft_fsl_pci_setup(void *blob, const char *pci_alias,
- struct pci_controller *hose)
+void ft_fsl_pci_setup(void *blob, const char *pci_compat,
+ struct pci_controller *hose, unsigned long ctrl_addr)
{
- int off = fdt_path_offset(blob, pci_alias);
+ int off;
u32 bus_range[2];
+ phys_addr_t p_ctrl_addr = (phys_addr_t)ctrl_addr;
+
+ /* convert ctrl_addr to true physical address */
+ p_ctrl_addr = (phys_addr_t)ctrl_addr - CONFIG_SYS_CCSRBAR;
+ p_ctrl_addr += CONFIG_SYS_CCSRBAR_PHYS;
+
+ off = fdt_node_offset_by_compat_reg(blob, pci_compat, p_ctrl_addr);
if (off < 0)
return;
/* We assume a cfg_addr not being set means we didn't setup the controller */
if ((hose == NULL) || (hose->cfg_addr == NULL)) {
- fdt_del_node_and_alias(blob, pci_alias);
+ fdt_del_node(blob, off);
} else {
bus_range[0] = 0;
bus_range[1] = hose->last_busno - hose->first_busno;
diff --git a/drivers/qe/qe.c b/drivers/qe/qe.c
index 63cc68e307..c4ec2f4af8 100644
--- a/drivers/qe/qe.c
+++ b/drivers/qe/qe.c
@@ -440,10 +440,8 @@ static int qe_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong addr;
- if (argc < 3) {
- cmd_usage(cmdtp);
- return 1;
- }
+ if (argc < 3)
+ return cmd_usage(cmdtp);
if (strcmp(argv[1], "fw") == 0) {
addr = simple_strtoul(argv[2], NULL, 16);
@@ -471,8 +469,7 @@ static int qe_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return qe_upload_firmware((const struct qe_firmware *) addr);
}
- cmd_usage(cmdtp);
- return 1;
+ return cmd_usage(cmdtp);
}
U_BOOT_CMD(
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 96d52fbaea..fae54177cb 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -1119,7 +1119,7 @@ int video_display_bitmap (ulong bmp_image, int x, int y)
case 8:
padded_line -= width;
if (VIDEO_DATA_FORMAT == GDF__8BIT_INDEX) {
- /* Copy colormap */
+ /* Copy colormap */
for (xcount = 0; xcount < colors; ++xcount) {
cte = bmp->color_table[xcount];
video_set_lut (xcount, cte.red, cte.green, cte.blue);
@@ -1321,11 +1321,11 @@ void logo_plot (void *screen, int width, int x, int y)
#ifdef CONFIG_VIDEO_BMP_LOGO
source = bmp_logo_bitmap;
- /* Allocate temporary space for computing colormap */
+ /* Allocate temporary space for computing colormap */
logo_red = malloc (BMP_LOGO_COLORS);
logo_green = malloc (BMP_LOGO_COLORS);
logo_blue = malloc (BMP_LOGO_COLORS);
- /* Compute color map */
+ /* Compute color map */
for (i = 0; i < VIDEO_LOGO_COLORS; i++) {
logo_red[i] = (bmp_logo_palette[i] & 0x0f00) >> 4;
logo_green[i] = (bmp_logo_palette[i] & 0x00f0);