From 7c050f818b51841de77fbfd077080d94f3c8b3ad Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Sat, 19 Jun 2010 20:41:56 +0200 Subject: video: cleanup comments in cfb_console.c and video_fb.h Signed-off-by: Anatolij Gustschin --- drivers/video/cfb_console.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 96d52fb..fae5417 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); -- cgit v1.1 From 6525d51fa5790727c04c4883341bc8f58f8e3bb3 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Thu, 8 Jul 2010 22:37:44 -0500 Subject: powerpc/85xx & 86xx: Rework ft_fsl_pci_setup to not require aliases Previously we used an alias the pci node to determine which node to fixup or delete. Now we use the new fdt_node_offset_by_compat_reg to find the node to update. Additionally, we replace the code in each board with a single macro call that makes assumes uniform naming and reduces duplication in this area. Signed-off-by: Kumar Gala --- drivers/pci/fsl_pci_init.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c index 5a63fa2..001e6eb 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 #include -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; -- cgit v1.1 From 19dbcc96c093acdf0b029b0ea616ca9761d3169f Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 21 Oct 2009 13:32:58 -0500 Subject: powerpc/p5020: Add various p5020 related defines (and p5010) There are various locations that we have chip specific info: * Makefile for which ddr code to build * Added p5020 & p5010 to cpu_type_list and SVR list * Added number of LAWs for p5020 * Set CONFIG_MAX_CPUS to 2 for p5020 Signed-off-by: Kumar Gala --- drivers/misc/fsl_law.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/misc/fsl_law.c b/drivers/misc/fsl_law.c index 628bd59..22270f1 100644 --- a/drivers/misc/fsl_law.c +++ b/drivers/misc/fsl_law.c @@ -43,7 +43,7 @@ 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_P4080) || defined(CONFIG_PPC_P5020) #define FSL_HW_NUM_LAWS 32 #else #error FSL_HW_NUM_LAWS not defined for this platform -- cgit v1.1 From c26de2d8b15c15fdc0a33758fa7714667eec404c Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 27 Jan 2010 10:26:46 -0600 Subject: powerpc/p3041: Add various p3041 related defines There are various locations that we have chip specific info: * Makefile for which ddr code to build * Added p3041 to cpu_type_list and SVR list * Added number of LAWs for p3041 * Set CONFIG_MAX_CPUS to 4 for p3041 Signed-off-by: Kumar Gala --- drivers/misc/fsl_law.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/misc/fsl_law.c b/drivers/misc/fsl_law.c index 22270f1..6589076 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) || defined(CONFIG_PPC_P5020) +#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 -- cgit v1.1 From 793b5726f7e998c7cec93ea5ee7910dd6ddb1e5e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 21 Jul 2010 13:38:02 -0400 Subject: i2c: soft_i2c: add simple GPIO implementation Since the vast majority of GPIO I2C implementations behave the same way, support the common GPIO framework with default settings. This adds two new defines CONFIG_SOFT_I2C_GPIO_{SCL,SDA} so that boards which want GPIO I2C support need only define these. Signed-off-by: Mike Frysinger Tested-by: Thomas Chou --- drivers/i2c/soft_i2c.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'drivers') diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c index e0cf1e1..1a1809a 100644 --- a/drivers/i2c/soft_i2c.c +++ b/drivers/i2c/soft_i2c.c @@ -51,6 +51,58 @@ #endif #include +#if defined(CONFIG_SOFT_I2C_GPIO_SCL) +# include + +# 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 -- cgit v1.1 From 47e26b1bf91ddef69f4a3892815c857db094cef9 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Sat, 17 Jul 2010 01:06:04 +0200 Subject: cmd_usage(): simplify return code handling Lots of code use this construct: cmd_usage(cmdtp); return 1; Change cmd_usage() let it return 1 - then we can replace all these ocurrances by return cmd_usage(cmdtp); This fixes a few places with incorrect return code handling, too. Signed-off-by: Wolfgang Denk --- drivers/gpio/pca953x.c | 3 +-- drivers/misc/ds4510.c | 13 +++++-------- drivers/misc/fsl_pmic.c | 20 ++++++++------------ drivers/qe/qe.c | 9 +++------ 4 files changed, 17 insertions(+), 28 deletions(-) (limited to 'drivers') diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c index d1065f4..6e82bd6 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/misc/ds4510.c b/drivers/misc/ds4510.c index 5b33c1f..aa893c3 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_pmic.c b/drivers/misc/fsl_pmic.c index 274327f..dca0a1d 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/qe/qe.c b/drivers/qe/qe.c index 63cc68e..c4ec2f4 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( -- cgit v1.1