[U-Boot] [PATCH v2] arm, davinci: cam_enc_4xx board updates
- CONFIG_SYS_MMC_ENV_DEV, needed if environment on mmc - wait for 1 second timer in board_late_init() only, if timer is running. - add UBI/UBIFS support - add FIT images support - menu support - U-Boot max size now 0xa - SPL now Block 0 page 0 - new MTD partitioning 0x SPL 0x0002 UBL-Header 0x0004 UBL-Header 0x0006 UBL-Header 0x0008 UBoot (0xa(U-Boot length) + 0x6(3 spare blocks)) 0x0018 ENV- Variablen (1) 0x001a ENV- Variablen (2) 0x001c ENV- Variablen (reserved for Bad Block) 0x001e ENV- Variablen (reserved for Bad Block) 0x0020 UBI-Device UBI Volumes: „default“: contain environment-default values „rootfs1“: UBIFS root-fs (1); contain linux kernel image „rootfs2“: UBIFS root-fs (2); contain linux kernel image „data-ro“: UBIFS data (read only) „data-rw“: UBIFS data (read/write) - new environment variables: - app_reset (this is only passed per cmdline to linux) - dvn_app_vers string from ramdisk description contained in the FIT image - dvn_boot_vers string from ubootimage description contained in the FIT image - saveparms, restoreparms, restoretmpparms, savetmpparms helper for saving network parameter. - ubiargs set ubi kernel cmdlinargs for booting with a ubifs rootfs - ubi_ubi boot with reading kernel image from ubifs, and use a ubifs as rootfs Signed-off-by: Heiko Schocher Cc: Sandeep Paulraj Cc: Tom Rini Cc: Albert ARIBAUD Cc: Mike Frysinger Cc: Wolfgang Denk --- - checkpatch shows no errors/warnings - patches needed for this patch: - arm, davinci: add workaround for not resetting DMA bus and VPSS modules http://patchwork.ozlabs.org/patch/136155/ - arm, davinci: add timer defines for tcr field http://patchwork.ozlabs.org/patch/136156/ - common, menu: enhancements http://lists.denx.de/pipermail/u-boot/2012-January/115904.html patches: - common: add possibility for readline_into_buffer timeout http://patchwork.ozlabs.org/patch/136415 - common, menu: add statusline support http://patchwork.ozlabs.org/patch/136417 - common, menu: show menu on startup if CONFIG_MENU_SHOW is defined http://patchwork.ozlabs.org/patch/136418 - a "MAKEALL -a arm" compiles fine with this patches - changes for v2: - rework as a result of a comment from Mike Frysinger: - menu_show get passed bootdelay, factor this in. - add comment from Wolfgang Denk: - use for FIT image type "firmware" and introduce a new "subtype" property, which contains the info, what sort of firmware the image is (ubl header, spl image, u-boot image or default environment). So following patch is not needed anymore: common, image: introduce new uimage types http://patchwork.ozlabs.org/patch/136157 - add comment from Tom Rini change comment in board/ait/cam_enc_4xx/ublimage.cfg board/ait/cam_enc_4xx/cam_enc_4xx.c | 667 ++- board/ait/cam_enc_4xx/ublimage.cfg |3 +- include/configs/cam_enc_4xx.h | 131 ++-- 3 files changed, 771 insertions(+), 30 deletions(-) diff --git a/board/ait/cam_enc_4xx/cam_enc_4xx.c b/board/ait/cam_enc_4xx/cam_enc_4xx.c index f438c15..5586576 100644 --- a/board/ait/cam_enc_4xx/cam_enc_4xx.c +++ b/board/ait/cam_enc_4xx/cam_enc_4xx.c @@ -20,6 +20,7 @@ */ #include +#include #include #include #include @@ -46,6 +47,12 @@ static unsigned long get_timer_val(void) return now; } +static int timer_running(void) +{ + return readl(&timer->tcr) & + (DV_TIMER_TCR_ENAMODE_MASK << DV_TIMER_TCR_ENAMODE34_SHIFT); +} + static void stop_timer(void) { writel(0x0, &timer->tcr); @@ -66,8 +73,43 @@ int board_init(void) } #ifdef CONFIG_DRIVER_TI_EMAC +static int cam_enc_4xx_check_network(void) +{ + char *s; + + s = getenv("ethaddr"); + if (!s) + return -EINVAL; + + if (!is_valid_ether_addr((const u8 *)s)) + return -EINVAL; + + s = getenv("ipaddr"); + if (!s) + return -EINVAL; + + s = getenv("netmask"); + if (!s) + return -EINVAL; + + s = getenv("serverip"); + if (!s) + return -EINVAL; + + s = getenv("gatewayip"); + if (!s) + return -EINVAL; + + return 0; +} int board_eth_init(bd_t *bis) { + int ret; + + ret = cam_enc_4xx_check_network(); + if (ret) + return ret; + davinci_emac_initialize(); return 0; @@ -254,8 +296,11 @@ static int nand_switch_hw_func(int mode) nand = mtd->priv; if (mode == 0) { - printf("switching to uboot hw functions.\n"); - memcpy(&nand->ecc, &org_ecc, sizeof(struct nand_ecc_ctrl)); + if (notsaved == 0) { + printf("switching to uboot hw functions.\n"); + memcpy(&nand->e
[U-Boot] [PATCH 3/3 v2] common, menu: show menu on startup if CONFIG_MENU_SHOW is defined
show a menu on startup instead running the shell. Signed-off-by: Heiko Schocher Cc: Jason Hobbs Cc: Mike Frysinger --- - changes for v2: - add comments from Mike Frysinger - pass current bootdelay to menu_show common/main.c |4 doc/README.menu |5 + include/menu.h |3 +++ 3 files changed, 12 insertions(+), 0 deletions(-) diff --git a/common/main.c b/common/main.c index 248744b..91e888f 100644 --- a/common/main.c +++ b/common/main.c @@ -41,6 +41,7 @@ #include #include +#include #if defined(CONFIG_SILENT_CONSOLE) || defined(CONFIG_POST) || defined(CONFIG_CMDLINE_EDITING) DECLARE_GLOBAL_DATA_PTR; @@ -372,6 +373,9 @@ void main_loop (void) debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay); +#if defined(CONFIG_MENU_SHOW) + bootdelay = menu_show(bootdelay); +#endif # ifdef CONFIG_BOOT_RETRY_TIME init_cmd_timeout (); # endif/* CONFIG_BOOT_RETRY_TIME */ diff --git a/doc/README.menu b/doc/README.menu index 4ddf914..6ce6bba 100644 --- a/doc/README.menu +++ b/doc/README.menu @@ -25,6 +25,11 @@ the interfaces should be available. Menus are composed of items. Each item has a key used to identify it in the menu, and an opaque pointer to data controlled by the consumer. +If you want to show a menu, instead starting the shell, define +CONFIG_MENU_SHOW. You have to code the int menu_show(int bootdelay) +function, which handle your menu. This function returns the remaining +bootdelay. + Interfaces -- #include "menu.h" diff --git a/include/menu.h b/include/menu.h index b806a02..7af5fdb 100644 --- a/include/menu.h +++ b/include/menu.h @@ -28,4 +28,7 @@ int menu_item_add(struct menu *m, char *item_key, void *item_data); int menu_destroy(struct menu *m); void menu_display_statusline(struct menu *m); +#if defined(CONFIG_MENU_SHOW) +int menu_show(int bootdelay); +#endif #endif /* __MENU_H__ */ -- 1.7.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/3 v2] common, menu: add statusline support
add the possibility to show a statusline when printing a menu Signed-off-by: Heiko Schocher Cc: Jason Hobbs Cc: Mike Frysinger --- - changes for v2: - add comments from Mike Frysinger : - add a prototype for the new function menu_display_statusline in menu.h and document it in doc/README.menu common/menu.c |8 doc/README.menu |5 + include/menu.h |1 + 3 files changed, 14 insertions(+), 0 deletions(-) diff --git a/common/menu.c b/common/menu.c index 3b1e0d0..754a9f9 100644 --- a/common/menu.c +++ b/common/menu.c @@ -113,6 +113,13 @@ static inline void *menu_item_destroy(struct menu *m, return NULL; } +void __menu_display_statusline(struct menu *m) +{ + return; +} +void menu_display_statusline(struct menu *m) + __attribute__ ((weak, alias("__menu_display_statusline"))); + /* * Display a menu so the user can make a choice of an item. First display its * title, if any, and then each item in the menu. @@ -123,6 +130,7 @@ static inline void menu_display(struct menu *m) puts(m->title); putc('\n'); } + menu_display_statusline(m); menu_items_iter(m, menu_item_print, NULL); } diff --git a/doc/README.menu b/doc/README.menu index 0dad6a2..4ddf914 100644 --- a/doc/README.menu +++ b/doc/README.menu @@ -69,6 +69,11 @@ int menu_get_choice(struct menu *m, void **choice); */ int menu_destroy(struct menu *m); +/* + * menu_display_statusline(struct menu *m); + * shows a statusline for every menu_display call. + */ +void menu_display_statusline(struct menu *m); Example Code diff --git a/include/menu.h b/include/menu.h index cf14a9c..b806a02 100644 --- a/include/menu.h +++ b/include/menu.h @@ -26,5 +26,6 @@ int menu_default_set(struct menu *m, char *item_key); int menu_get_choice(struct menu *m, void **choice); int menu_item_add(struct menu *m, char *item_key, void *item_data); int menu_destroy(struct menu *m); +void menu_display_statusline(struct menu *m); #endif /* __MENU_H__ */ -- 1.7.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v5 3/3] ARMV7: Exynos4: Add support for TRATS board
This patch adds support for Samsung TRATS board Signed-off-by: HeungJun, Kim Signed-off-by: Kyungmin Park --- Changes for v2: - sort the list of the name in MAINTAINERS - modify to GPLv2+ - change assem code in lowlevel_init.S to C code in lowlevel_util.c - do not defile values for variables if the variable is feature - remove miscellaneouses Changes for v3: - implement lowlevel_init.S by C - remove lowlevel_init.S, the functions is inserted into trats.c - add watchdog.h for Exynos4 - add power.h amd modify cpu.h for Exynos4 Changes for RESEND since v3 - Add prefix board_ for board functions - Rename setup.h from trats_setup.h - Remove *_OFFSET in setup.h - Remove GPIO and UART definitions in setup.h Changes for v4: - add selection UART direction for TRATS board Changes for v5: - replace lowlevel_init() to board_early_init_f(). - add CONFIG_SKIP_LOWLEVEL_INIT, CONFIG_BOARD_EARLY_INIT_F MAINTAINERS |4 + board/samsung/trats/Makefile | 43 +++ board/samsung/trats/setup.h | 637 ++ board/samsung/trats/trats.c | 379 + boards.cfg |1 + include/configs/trats.h | 216 ++ 6 files changed, 1280 insertions(+), 0 deletions(-) create mode 100644 board/samsung/trats/Makefile create mode 100644 board/samsung/trats/setup.h create mode 100644 board/samsung/trats/trats.c create mode 100644 include/configs/trats.h diff --git a/MAINTAINERS b/MAINTAINERS index ebab90e..ce70558 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -712,6 +712,10 @@ Chander Kashyap origen ARM ARMV7 (EXYNOS4210 SoC) SMDKV310ARM ARMV7 (EXYNOS4210 SoC) +Heungjun Kim + + trats ARM ARMV7 (EXYNOS4210 SoC) + Torsten Koschorrek scb9328 ARM920T (i.MXL) diff --git a/board/samsung/trats/Makefile b/board/samsung/trats/Makefile new file mode 100644 index 000..d21883f --- /dev/null +++ b/board/samsung/trats/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2011 Samsung Electronics +# Heungjun Kim +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS-y+= trats.o + +SRCS:= $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS-y)) + +$(LIB):$(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/samsung/trats/setup.h b/board/samsung/trats/setup.h new file mode 100644 index 000..a479b5c --- /dev/null +++ b/board/samsung/trats/setup.h @@ -0,0 +1,637 @@ +/* + * Machine Specific Values for TRATS board based on EXYNOS4210 + * + * Copyright (C) 2011 Samsung Electronics + * Heungjun Kim + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef _TRATS_SETUP_H +#define _TRATS_SETUP_H + +#include +#include +#include + +/* CLK_SRC_CPU: APLL(1), MPLL(1), CORE(0), HPM(0) */ +#define MUX_HPM_SEL_MOUTAPLL 0x0 +#define MUX_HPM_SEL_SCLKMPLL 0x1 +#define MUX_CORE_SEL_MOUTAPLL 0x0 +#define MUX_CORE_SEL_SCLKMPLL 0x1 +#define MUX_MPLL_SEL_FILPLL0x0 +#define MUX_MPLL_SEL_MOUTMPLLFOUT 0x1 +#define MUX
[U-Boot] [PATCH 1/3 v2] common: add possibility for readline_into_buffer timeout
add possibility to add a timeout when reading a line into a buffer. Signed-off-by: Heiko Schocher Cc: Mike Frysinger --- - changes for v2: - add comments from Mike Frysinger : - remove useless inner parens - rework timeout handling in readline_into_buffer(): use endtick(), drop CONIG_SYS_HZ usage common/cmd_nvedit.c |2 +- common/main.c | 20 common/menu.c |3 ++- include/common.h|3 ++- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 63afc82..20080dc 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -502,7 +502,7 @@ int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) else buffer[0] = '\0'; - readline_into_buffer("edit: ", buffer); + readline_into_buffer("edit: ", buffer, 0); return setenv(argv[1], buffer); } diff --git a/common/main.c b/common/main.c index e96c95a..248744b 100644 --- a/common/main.c +++ b/common/main.c @@ -685,7 +685,8 @@ static void cread_add_str(char *str, int strsize, int insert, unsigned long *num } } -static int cread_line(const char *const prompt, char *buf, unsigned int *len) +static int cread_line(const char *const prompt, char *buf, unsigned int *len, + int timeout) { unsigned long num = 0; unsigned long eol_num = 0; @@ -695,6 +696,7 @@ static int cread_line(const char *const prompt, char *buf, unsigned int *len) int esc_len = 0; char esc_save[8]; int init_len = strlen(buf); + int first = 1; if (init_len) cread_add_str(buf, init_len, 1, &num, &eol_num, buf, *len); @@ -707,6 +709,16 @@ static int cread_line(const char *const prompt, char *buf, unsigned int *len) WATCHDOG_RESET(); } #endif + if (first && timeout) { + uint64_t etime = endtick(timeout); + + while (!tstc()) { /* while no incoming data */ + if (get_ticks() >= etime) + return -2; /* timed out */ + WATCHDOG_RESET(); + } + first = 0; + } ichar = getcmd_getch(); @@ -922,11 +934,11 @@ int readline (const char *const prompt) */ console_buffer[0] = '\0'; - return readline_into_buffer(prompt, console_buffer); + return readline_into_buffer(prompt, console_buffer, 0); } -int readline_into_buffer (const char *const prompt, char * buffer) +int readline_into_buffer(const char *const prompt, char *buffer, int timeout) { char *p = buffer; #ifdef CONFIG_CMDLINE_EDITING @@ -949,7 +961,7 @@ int readline_into_buffer (const char *const prompt, char * buffer) if (prompt) puts (prompt); - rc = cread_line(prompt, p, &len); + rc = cread_line(prompt, p, &len, timeout); return rc < 0 ? rc : len; } else { diff --git a/common/menu.c b/common/menu.c index 5e0817c..3b1e0d0 100644 --- a/common/menu.c +++ b/common/menu.c @@ -222,7 +222,8 @@ static inline int menu_interactive_choice(struct menu *m, void **choice) menu_display(m); - readret = readline_into_buffer("Enter choice: ", cbuf); + readret = readline_into_buffer("Enter choice: ", cbuf, + m->timeout); if (readret >= 0) { choice_item = menu_item_by_key(m, cbuf); diff --git a/include/common.h b/include/common.h index 3df1def..7a9b3a2 100644 --- a/include/common.h +++ b/include/common.h @@ -265,7 +265,8 @@ int run_command (const char *cmd, int flag); int run_command2(const char *cmd, int flag); #endif intreadline(const char *const prompt); -intreadline_into_buffer(const char *const prompt, char * buffer); +intreadline_into_buffer(const char *const prompt, char *buffer, + int timeout); intparse_line (char *, char *[]); void init_cmd_timeout(void); void reset_cmd_timeout(void); -- 1.7.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/3] WIP: tegra: i2c: Enable new I2C framework
This is just a rough patch to show how this might be done. Not to be applied, please. Signed-off-by: Simon Glass --- drivers/i2c/tegra2_i2c.c | 53 +++ include/configs/seaboard.h |2 + 2 files changed, 25 insertions(+), 30 deletions(-) diff --git a/drivers/i2c/tegra2_i2c.c b/drivers/i2c/tegra2_i2c.c index b42d9ac..93f3269 100644 --- a/drivers/i2c/tegra2_i2c.c +++ b/drivers/i2c/tegra2_i2c.c @@ -30,7 +30,9 @@ #include #include #include + #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -296,12 +298,7 @@ static int tegra2_i2c_read_data(u32 addr, u8 *data, u32 len) #error "Please enable device tree support to use this driver" #endif -unsigned int i2c_get_bus_speed(void) -{ - return i2c_controllers[i2c_bus_num].speed; -} - -int i2c_set_bus_speed(unsigned int speed) +uint tegra_i2c_set_bus_speed(unsigned int speed) { struct i2c_bus *i2c_bus; @@ -309,7 +306,7 @@ int i2c_set_bus_speed(unsigned int speed) i2c_bus->speed = speed; i2c_init_controller(i2c_bus); - return 0; + return 0; /* TODO: return actual speed */ } static int i2c_get_config(const void *blob, int node, struct i2c_bus *i2c_bus) @@ -404,7 +401,7 @@ int i2c_init_board(void) return 0; } -void i2c_init(int speed, int slaveaddr) +void tegra_i2c_init(int speed, int slaveaddr) { debug("i2c_init(speed=%u, slaveaddr=0x%x)\n", speed, slaveaddr); } @@ -450,7 +447,7 @@ int i2c_read_data(uchar chip, uchar *buffer, int len) } /* Probe to see if a chip is present. */ -int i2c_probe(uchar chip) +int tegra_i2c_probe(uchar chip) { int rc; uchar reg; @@ -472,7 +469,7 @@ static int i2c_addr_ok(const uint addr, const int alen) } /* Read bytes */ -int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len) +int tegra_i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len) { uint offset; int i; @@ -506,7 +503,7 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len) } /* Write bytes */ -int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len) +int tegra_i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len) { uint offset; int i; @@ -531,25 +528,6 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len) return 0; } -#if defined(CONFIG_I2C_MULTI_BUS) -/* - * Functions for multiple I2C bus handling - */ -unsigned int i2c_get_bus_num(void) -{ - return i2c_bus_num; -} - -int i2c_set_bus_num(unsigned int bus) -{ - if (bus >= CONFIG_SYS_MAX_I2C_BUS || !i2c_controllers[bus].inited) - return -1; - i2c_bus_num = bus; - - return 0; -} -#endif - int tegra_i2c_get_dvc_bus_num(void) { int i; @@ -563,3 +541,18 @@ int tegra_i2c_get_dvc_bus_num(void) return -1; } + +struct i2c_adapter tegra_i2c_adap[] = { + { + .init = tegra_i2c_init, + .probe = tegra_i2c_probe, + .read = tegra_i2c_read, + .write = tegra_i2c_write, + .set_bus_speed = tegra_i2c_set_bus_speed, + .speed = 10, + .slaveaddr = 0, + .name = "tegra-i2c", + .init_done = 0, + .hwadapnr = 0, + } +}; diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h index d2d0115..64c804a 100644 --- a/include/configs/seaboard.h +++ b/include/configs/seaboard.h @@ -79,6 +79,8 @@ #define CONFIG_SYS_MAX_I2C_BUS 4 #define CONFIG_SYS_I2C_SPEED 10 #define CONFIG_CMD_I2C +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_ADAPTERS{&tegra_i2c_adap} /* SD/MMC */ #define CONFIG_MMC -- 1.7.7.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support
From: Heiko Schocher This Patch introduce the new i2c_core file, which holds the I2C core functions, for the rework of the multibus/ multiadapter support. Also adds changes in i2c.h for the new I2C multibus/multiadapter support. This new support can be activated with the CONFIG_SYS_I2C define. Signed-off-by: Heiko Schocher Signed-off-by: Simon Glass --- arch/arm/include/asm/global_data.h|3 + arch/avr32/include/asm/global_data.h |3 + arch/blackfin/include/asm/global_data.h |4 +- arch/m68k/include/asm/global_data.h |3 + arch/microblaze/include/asm/global_data.h |3 + arch/mips/include/asm/global_data.h |3 + arch/nios2/include/asm/global_data.h |3 + arch/powerpc/include/asm/global_data.h|3 + arch/sh/include/asm/global_data.h |3 + arch/sparc/include/asm/global_data.h |3 + arch/x86/include/asm/global_data.h|3 + drivers/i2c/Makefile |1 + drivers/i2c/i2c_core.c| 360 + include/i2c.h | 199 +++- 14 files changed, 584 insertions(+), 10 deletions(-) create mode 100644 drivers/i2c/i2c_core.c diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h index 23a6077..924cea2 100644 --- a/arch/arm/include/asm/global_data.h +++ b/arch/arm/include/asm/global_data.h @@ -87,6 +87,9 @@ typedef struct global_data { unsigned long post_log_res; /* success of POST test */ unsigned long post_init_f_time; /* When post_init_f started */ #endif +#if defined(CONFIG_SYS_I2C) + void*cur_adap; /* current used i2c adapter */ +#endif } gd_t; /* diff --git a/arch/avr32/include/asm/global_data.h b/arch/avr32/include/asm/global_data.h index 5c654bd..605b1a7 100644 --- a/arch/avr32/include/asm/global_data.h +++ b/arch/avr32/include/asm/global_data.h @@ -50,6 +50,9 @@ typedef struct global_data { #endif void**jt; /* jump table */ charenv_buf[32];/* buffer for getenv() before reloc. */ +#if defined(CONFIG_SYS_I2C) + void*cur_adap; /* current used i2c adapter */ +#endif } gd_t; /* diff --git a/arch/blackfin/include/asm/global_data.h b/arch/blackfin/include/asm/global_data.h index 67aa30f..eacfd17 100644 --- a/arch/blackfin/include/asm/global_data.h +++ b/arch/blackfin/include/asm/global_data.h @@ -56,9 +56,11 @@ typedef struct global_data { unsigned long post_log_res; /* success of POST test */ unsigned long post_init_f_time; /* When post_init_f started */ #endif - void**jt; /* jump table */ charenv_buf[32];/* buffer for getenv() before reloc. */ +#if defined(CONFIG_SYS_I2C) + void*cur_adap; /* current used i2c adapter */ +#endif } gd_t; /* diff --git a/arch/m68k/include/asm/global_data.h b/arch/m68k/include/asm/global_data.h index 0ba2b43..fb171f8 100644 --- a/arch/m68k/include/asm/global_data.h +++ b/arch/m68k/include/asm/global_data.h @@ -68,6 +68,9 @@ typedef struct global_data { #endif void**jt; /* Standalone app jump table */ charenv_buf[32];/* buffer for getenv() before reloc. */ +#if defined(CONFIG_SYS_I2C) + void*cur_adap; /* current used i2c adapter */ +#endif } gd_t; /* diff --git a/arch/microblaze/include/asm/global_data.h b/arch/microblaze/include/asm/global_data.h index 6e8537c..a43ca0d 100644 --- a/arch/microblaze/include/asm/global_data.h +++ b/arch/microblaze/include/asm/global_data.h @@ -47,6 +47,9 @@ typedef struct global_data { unsigned long fb_base;/* base address of frame buffer */ void**jt; /* jump table */ charenv_buf[32];/* buffer for getenv() before reloc. */ +#if defined(CONFIG_SYS_I2C) + void*cur_adap; /* current used i2c adapter */ +#endif } gd_t; /* diff --git a/arch/mips/include/asm/global_data.h b/arch/mips/include/asm/global_data.h index f6cf9fe..436c0c7 100644 --- a/arch/mips/include/asm/global_data.h +++ b/arch/mips/include/asm/global_data.h @@ -61,6 +61,9 @@ typedef struct global_data { unsigned long env_valid; /* Checksum of Environment valid? */ void**jt; /* jump table */ charenv_buf[32];/* buffer for getenv() before reloc. */ +#if defined(CONFIG_SYS_I2C) + void*cur_adap; /* current used i2c adapter */ +#endif } gd_t; /* diff --git a/arch/nios2/include/asm/global_data.h b/arch/nios2/include/asm/global_data.h index 4b86fbd..714e2f8 100644 --- a/arch/nios2/include/asm/global_data.h +++ b/arch/nios2/include/asm/global_data.h @@ -42,6 +42,9 @@ typedef struct global_data { #endif void**jt;
[U-Boot] [PATCH 2/3] i2c: common changes for multibus/multiadapter support
From: Heiko Schocher Signed-off-by: Heiko Schocher Signed-off-by: Simon Glass --- README | 82 - arch/arm/lib/board.c|3 +- arch/blackfin/lib/board.c |7 ++ arch/m68k/lib/board.c | 18 +- arch/mips/lib/board.c |7 ++ arch/powerpc/cpu/mpc8xx/video.c |4 + arch/powerpc/lib/board.c| 18 +- common/cmd_date.c |9 +++ common/cmd_dtt.c|9 +++ common/cmd_i2c.c| 127 +- common/stdio.c | 13 - include/i2c.h |9 --- 12 files changed, 242 insertions(+), 64 deletions(-) diff --git a/README b/README index 7adf7c7..fe1c0d9 100644 --- a/README +++ b/README @@ -1669,9 +1669,85 @@ The following options need to be configured: on those systems that support this (optional) feature, like the TQM8xxL modules. -- I2C Support: CONFIG_HARD_I2C | CONFIG_SOFT_I2C - - These enable I2C serial bus commands. Defining either of +- I2C Support: CONFIG_SYS_I2C + + This enable the NEW i2c subsystem, and will allow you to use + i2c commands at the u-boot command line (as long as you set + CONFIG_CMD_I2C in CONFIG_COMMANDS) and communicate with i2c + based realtime clock chips or other i2c devices. See + common/cmd_i2c.c for a description of the command line + interface. + + additional defines: + + CONFIG_SYS_NUM_I2C_ADAPTERS + define how many i2c adapters you want to use on your + hardware. If you need only 1 i2c adapter, you can ommit + this define. + + CONFIG_SYS_I2C_ADAPTERS + hold a list of adapters you want to use, for example: + {&soft_i2c_adap[0], &mpc5xxx_i2c_adap[0]} + with this configuration you have one soft_i2c adapter, + and one mpc5xxx i2c adapter. + + No I2C adapters current suppor this new interface. + + You need to define for each adapter a speed and a + slave address. + + CONFIG_SYS_NUM_I2C_BUSSES + Hold the number of i2c busses you want to use. If you + don't use/have i2c muxes on your i2c bus, this + is equal to CONFIG_SYS_NUM_I2C_ADAPTERS, and you can + omit this define. + + CONFIG_SYS_I2C_DIRECT_BUS + define this, if you don't use i2c muxes on your hardware. + if CONFIG_SYS_I2C_MAX_HOPS is not defined or == 0 you can + omit this define. + + CONFIG_SYS_I2C_MAX_HOPS + define how many muxes are maximal consecutively connected + on one i2c bus. + + CONFIG_SYS_I2C_BUSSES + hold a list of busses you want to use, only used if + CONFIG_SYS_I2C_DIRECT_BUS is not defined, for example + a board with CONFIG_SYS_I2C_MAX_HOPS = 1 and + CONFIG_SYS_NUM_I2C_BUSSES = 9: + +CONFIG_SYS_I2C_BUSSES {{0, {I2C_NULL_HOP}}, \ + {0, {{I2C_MUX_PCA9547, 0x70, 1}}}, \ + {0, {{I2C_MUX_PCA9547, 0x70, 2}}}, \ + {0, {{I2C_MUX_PCA9547, 0x70, 3}}}, \ + {0, {{I2C_MUX_PCA9547, 0x70, 4}}}, \ + {0, {{I2C_MUX_PCA9547, 0x70, 5}}}, \ + {1, {I2C_NULL_HOP}}, \ + {1, {{I2C_MUX_PCA9544, 0x72, 1}}}, \ + {1, {{I2C_MUX_PCA9544, 0x72, 2}}}, \ + } + + which defines + bus 0 on adapter 0 without a mux + bus 1 on adapter 0 without a PCA9547 on address 0x70 port 1 + bus 2 on adapter 0 without a PCA9547 on address 0x70 port 2 + bus 3 on adapter 0 without a PCA9547 on address 0x70 port 3 + bus 4 on adapter 0 without a PCA9547 on address 0x70 port 4 + bus 5 on adapter 0 without a PCA9547 on address 0x70 port 5 + bus 6 on adapter 1 without a mux + bus 7 on adapter 1 without a PCA9544 on address 0x72 port 1 + bus 8 on adapter 1 without a PCA9544 on address 0x72 port 2 + +- Legacy I2C Support: CONFIG_HARD_I2C | CONFIG_SOFT_I2C + + NOTE: It is intended to move drivers to CONFIG_SYS_I2C which + provides the following compelling advantages: + 1. Heiko to fill in + + ** Please consider updating your I2C driver now. ** + + These enable leg
[U-Boot] [PATCH v5 1/3] ARMV7: Exynos4: Add watchdog.h for Exynos4
This patch add watchdog.h for Exynos4 Signed-off-by: HeungJun, Kim Signed-off-by: Kyungmin Park --- Changes for v3: - Created Changes for v4: - Not changed Changes for v4: - Not changed arch/arm/include/asm/arch-exynos/watchdog.h | 53 +++ 1 files changed, 53 insertions(+), 0 deletions(-) create mode 100644 arch/arm/include/asm/arch-exynos/watchdog.h diff --git a/arch/arm/include/asm/arch-exynos/watchdog.h b/arch/arm/include/asm/arch-exynos/watchdog.h new file mode 100644 index 000..3015875 --- /dev/null +++ b/arch/arm/include/asm/arch-exynos/watchdog.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2011 Samsung Electronics + * Heungjun Kim + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASM_ARM_ARCH_WATCHDOG_H_ +#define __ASM_ARM_ARCH_WATCHDOG_H_ + +#define WTCON_RESET_OFFSET 0 +#define WTCON_INTEN_OFFSET 2 +#define WTCON_CLKSEL_OFFSET3 +#define WTCON_EN_OFFSET5 +#define WTCON_PRE_OFFSET 8 + +#define WTCON_CLK_16 0x0 +#define WTCON_CLK_32 0x1 +#define WTCON_CLK_64 0x2 +#define WTCON_CLK_128 0x3 + +#define WTCON_CLK(x) ((x & 0x3) << WTCON_CLKSEL_OFFSET) +#define WTCON_PRESCALER(x) ((x) << WTCON_PRE_OFFSET) +#define WTCON_EN (0x1 << WTCON_EN_OFFSET) +#define WTCON_RESET(0x1 << WTCON_RESET_OFFSET) +#define WTCON_INT (0x1 << WTCON_INTEN_OFFSET) + +#ifndef __ASSEMBLY__ +struct exynos4_watchdog { + unsigned int wtcon; + unsigned int wtdat; + unsigned int wtcnt; + unsigned int wtclrint; +}; +#endif /* __ASSEMBLY__ */ + +#endif -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v5 2/3] ARMV7: Exynos4: Add supoort power for Exynos4
This patch adds power.h and SAMSUNG_BASE() macro for using Exynos4 power. Signed-off-by: HeungJun, Kim Signed-off-by: Kyungmin Park --- Changes for v3: - Created Changes for v4: - Not changed Changes for v5: - Not changed arch/arm/include/asm/arch-exynos/cpu.h |1 + arch/arm/include/asm/arch-exynos/power.h | 230 ++ 2 files changed, 231 insertions(+), 0 deletions(-) create mode 100644 arch/arm/include/asm/arch-exynos/power.h diff --git a/arch/arm/include/asm/arch-exynos/cpu.h b/arch/arm/include/asm/arch-exynos/cpu.h index 6d97b99..3496616 100644 --- a/arch/arm/include/asm/arch-exynos/cpu.h +++ b/arch/arm/include/asm/arch-exynos/cpu.h @@ -109,6 +109,7 @@ SAMSUNG_BASE(uart, UART_BASE) SAMSUNG_BASE(usb_phy, USBPHY_BASE) SAMSUNG_BASE(usb_otg, USBOTG_BASE) SAMSUNG_BASE(watchdog, WATCHDOG_BASE) +SAMSUNG_BASE(power, POWER_BASE) #endif #endif /* _EXYNOS4_CPU_H */ diff --git a/arch/arm/include/asm/arch-exynos/power.h b/arch/arm/include/asm/arch-exynos/power.h new file mode 100644 index 000..fb442f7 --- /dev/null +++ b/arch/arm/include/asm/arch-exynos/power.h @@ -0,0 +1,230 @@ +/* + * Copyright (C) 2011 Samsung Electronics + * Heungjun Kim + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASM_ARM_ARCH_POWER_H_ +#define __ASM_ARM_ARCH_POWER_H_ + +#ifndef __ASSEMBLY__ +struct exynos4_power { + unsigned intom_stat; + unsigned char res1[0x8]; + unsigned intrtc_clko_sel; + unsigned intgnss_rtc_out_ctrl; + unsigned char res2[0x1ec]; + unsigned intsystem_power_down_ctrl; + unsigned char res3[0x1]; + unsigned intsystem_power_down_option; + unsigned char res4[0x1f4]; + unsigned intswreset; + unsigned intrst_stat; + unsigned char res5[0x1f8]; + unsigned intwakeup_stat; + unsigned inteint_wakeup_mask; + unsigned intwakeup_mask; + unsigned char res6[0xf4]; + unsigned inthdmi_phy_control; + unsigned intusbdevice_phy_control; + unsigned intusbhost_phy_control; + unsigned intdac_phy_control; + unsigned intmipi_phy0_control; + unsigned intmipi_phy1_control; + unsigned intadc_phy_control; + unsigned intpcie_phy_control; + unsigned intsata_phy_control; + unsigned char res7[0xdc]; + unsigned intinform0; + unsigned intinform1; + unsigned intinform2; + unsigned intinform3; + unsigned intinform4; + unsigned intinform5; + unsigned intinform6; + unsigned intinform7; + unsigned char res8[0x1e0]; + unsigned intpmu_debug; + unsigned char res9[0x5fc]; + unsigned intarm_core0_sys_pwr_reg; + unsigned char res10[0xc]; + unsigned intarm_core1_sys_pwr_reg; + unsigned char res11[0x6c]; + unsigned intarm_common_sys_pwr_reg; + unsigned char res12[0x3c]; + unsigned intarm_cpu_l2_0_sys_pwr_reg; + unsigned intarm_cpu_l2_1_sys_pwr_reg; + unsigned char res13[0x38]; + unsigned intcmu_aclkstop_sys_pwr_reg; + unsigned intcmu_sclkstop_sys_pwr_reg; + unsigned char res14[0x4]; + unsigned intcmu_reset_sys_pwr_reg; + unsigned char res15[0x10]; + unsigned intapll_sysclk_sys_pwr_reg; + unsigned intmpll_sysclk_sys_pwr_reg; + unsigned intvpll_sysclk_sys_pwr_reg; + unsigned intepll_sysclk_sys_pwr_reg; + unsigned char res16[0x8]; + unsigned intcmu_clkstop_gps_alive_sys_pwr_reg; + unsigned intcmu_reset_gps_alive_sys_pwr_reg; + unsigned intcmu_clkstop_cam_sys_pwr_reg; + unsigned intcmu_clkstop_tv_sys_pwr_reg; + unsigned intcmu_clkstop_mfc_sys_pwr_reg; + unsigned intcmu_clkstop_g3d_sys_pwr_reg; + unsigned intcmu_clkstop_lcd0_sys_pwr_reg; + unsigned intcmu_clkstop_lcd1_sys_pwr_reg; + unsigned intcmu_clkstop_maudio_sys_pwr_reg; + unsigned intcmu_clkstop_gps_sys_pwr_reg; + unsigned intcmu_reset_cam_sys_pwr_reg; +
[U-Boot] [PATCH v5 0/3] ARMV7: Exynos4: Add support for TRATS board
This patch series support for Samsung TRATS board, and add the headers of watchdog and power, and current version is 4. I missed logs of v2 on this thread, so I'm going to add this: http://lists.denx.de/pipermail/u-boot/2012-January/114857.html Also, this patch is tested on Samsung TRATS board. Thank you. Best Regards, Heungjun Kim HeungJun, Kim (3): ARMV7: Exynos4: Add watchdog.h for Exynos4 ARMV7: Exynos4: Add supoort power for Exynos4 ARMV7: Exynos4: Add support for TRATS board MAINTAINERS |4 + arch/arm/include/asm/arch-exynos/cpu.h |1 + arch/arm/include/asm/arch-exynos/power.h| 230 ++ arch/arm/include/asm/arch-exynos/watchdog.h | 53 +++ board/samsung/trats/Makefile| 43 ++ board/samsung/trats/setup.h | 637 +++ board/samsung/trats/trats.c | 379 boards.cfg |1 + include/configs/trats.h | 216 + 9 files changed, 1564 insertions(+), 0 deletions(-) create mode 100644 arch/arm/include/asm/arch-exynos/power.h create mode 100644 arch/arm/include/asm/arch-exynos/watchdog.h create mode 100644 board/samsung/trats/Makefile create mode 100644 board/samsung/trats/setup.h create mode 100644 board/samsung/trats/trats.c create mode 100644 include/configs/trats.h -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/3] ARM: AM33XX: Add i2c support
Chandan, On Mon, Jan 16, 2012 at 12:37:37, Kumar Nath, Chandan wrote: > Rachna, > > > -Original Message- > > From: Patil, Rachna > > Sent: Friday, January 13, 2012 3:34 PM > > To: u-boot@lists.denx.de > > Cc: Rini, Tom; Kumar Nath, Chandan; Zhang, Jonathan; Patil, Rachna > > Subject: [PATCH 3/3] ARM: AM33XX: Add i2c support > > > > Add i2c driver board hookup for AM335X EVM. > > > > Signed-off-by: Chandan Nath > > Signed-off-by: Patil, Rachna > > --- > > arch/arm/cpu/armv7/am33xx/clock.c |5 ++ > > arch/arm/include/asm/arch-am33xx/common_def.h |1 + > > arch/arm/include/asm/arch-am33xx/cpu.h|3 +- > > arch/arm/include/asm/arch-am33xx/i2c.h| 81 > > + > > board/ti/am335x/evm.c |6 ++ > > board/ti/am335x/mux.c | 14 > > include/configs/am335x_evm.h |9 +++ > > 7 files changed, 118 insertions(+), 1 deletions(-) create mode > > 100644 arch/arm/include/asm/arch-am33xx/i2c.h > > [] > > > +void enable_i2c0_pin_mux(void) > > +{ > > + configure_module_pin_mux(i2c0_pin_mux); > > +} > > + > > Remove this extra line in EOF. This shows whitespace error while doing git am. Ok. I will take care of this in v2. [SNIP] Regards, Rachna ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/3] Bring in new I2C framework
This series provides Heiko's upgraded I2C framework from a few years ago. I hope that we can bring this in and move boards over to it as time permits, rather than switching everything in one fell swoop which never happens. To show it working I have enabled it for Tegra in a very rough way. It seems fine with my limited testing. In terms of changes, I have just fixed some checkpatch errors and fiddled with a couple of function signatures. I will start a thread on the list with a few thoughts on this series at some point. Heiko Schocher (2): i2c: add i2c_core and prepare for new multibus support i2c: common changes for multibus/multiadapter support Simon Glass (1): WIP: tegra: i2c: Enable new I2C framework README| 82 +++- arch/arm/include/asm/global_data.h|3 + arch/arm/lib/board.c |3 +- arch/avr32/include/asm/global_data.h |3 + arch/blackfin/include/asm/global_data.h |4 +- arch/blackfin/lib/board.c |7 + arch/m68k/include/asm/global_data.h |3 + arch/m68k/lib/board.c | 18 ++- arch/microblaze/include/asm/global_data.h |3 + arch/mips/include/asm/global_data.h |3 + arch/mips/lib/board.c |7 + arch/nios2/include/asm/global_data.h |3 + arch/powerpc/cpu/mpc8xx/video.c |4 + arch/powerpc/include/asm/global_data.h|3 + arch/powerpc/lib/board.c | 18 ++- arch/sh/include/asm/global_data.h |3 + arch/sparc/include/asm/global_data.h |3 + arch/x86/include/asm/global_data.h|3 + common/cmd_date.c |9 + common/cmd_dtt.c |9 + common/cmd_i2c.c | 127 +++ common/stdio.c| 13 +- drivers/i2c/Makefile |1 + drivers/i2c/i2c_core.c| 360 + drivers/i2c/tegra2_i2c.c | 53 ++--- include/configs/seaboard.h|2 + include/i2c.h | 190 +++- 27 files changed, 842 insertions(+), 95 deletions(-) create mode 100644 drivers/i2c/i2c_core.c -- 1.7.7.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 1/9] fdt: Add fdtdec functions to read byte array
Hi Mike, On Mon, Jan 16, 2012 at 10:30 PM, Mike Frysinger wrote: > On Tuesday 17 January 2012 01:11:14 Simon Glass wrote: >> From: Anton Staff >> >> Sometimes we don't need a full cell for each value. This provides >> a simple function to read a byte array, both with and without >> copying it. >> >> Signed-off-by: Simon Glass > > seems like getting s-o-b from Anton should be fairly easy ;) > I have the jellybeans ready. I will make a list of those I need - it is a pretty long list now. Does patchwork pick it up automatically if they reply to the list? Regards, Simon > (there's a few other patches in this series with that problem) > -mike ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] ARM: I2C: I2C Multi byte address support
Hi Heiko On Fri, Jan 13, 2012 at 17:36:11, Heiko Schocher wrote: > Hello Patil, > > Patil, Rachna wrote: > > Existing OMAP I2C driver does not support address length greater than > > one. Hence this patch is to add support for 2 byte address read/write. > > > > Signed-off-by: Philip, Avinash > > Signed-off-by: Hebbar, Gururaja > > Signed-off-by: Patil, Rachna > > --- > > drivers/i2c/omap24xx_i2c.c | 477 > > > > drivers/i2c/omap24xx_i2c.h |2 + > > 2 files changed, 306 insertions(+), 173 deletions(-) > > Please check this patch with tools/checkpatch.pl, it throws some "WARNING: > braces {} are not necessary for single statement blocks" warnings, please fix. I will clean this up. > > > diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c > > index 4ae237a..88e26b2 100644 > > --- a/drivers/i2c/omap24xx_i2c.c > > +++ b/drivers/i2c/omap24xx_i2c.c > > @@ -29,10 +29,11 @@ > > > > DECLARE_GLOBAL_DATA_PTR; > > > > -#define I2C_TIMEOUT1000 > > +#define I2C_TIMEOUT(1 << 31) > > ? Why this? What has this to do with 2 address byte support? > > Maybe you change the usage of this define from timeout to a bitmask? If so, > please do this in a seperate patch. Yes, I am using this to define a bitmask, but this applies to changes done in this patch. > > > +#define I2C_STAT_TIMEO 10 > > Could you explain, for what purpose this new timeout is? I have interchanged the meaning of the above two definitions. I2C_STAT_TIMEO would reserve the purpose of I2C_TIMEOUT. To avoid confusion I will retain the original definition of I2C_TIMEOUT And add the bit definition to I2C_STAT_TIMEO, so that would be #define I2C_TIMEOUT 10 #define I2C_STAT_TIMEO (1 << 31) > > > -static void wait_for_bb(void); > > -static u16 wait_for_pin(void); > > +static u32 wait_for_bb(void); > > +static u32 wait_for_status_mask(u16 mask); > > static void flush_fifo(void); > > > > static struct i2c *i2c_base = (struct i2c *)I2C_DEFAULT_BASE; > [...] > > int i2c_probe(uchar chip) > > { > > + writew(I2C_CON_EN | I2C_CON_MST | I2C_CON_STT > > + | I2C_CON_STP, &i2c_base->con); > > + /* enough delay for the NACK bit set */ > > + udelay(5); > > Huh... big delay? Is this really needed? I kept this delay big keeping in mind that some devices may need more time to respond. However I have tested by reducing the delay and is still works. I will reduce this to 9000. > > > + > > + if (!(readw(&i2c_base->stat) & I2C_STAT_NACK)) { > > + res = 0; /* success case */ > > + flush_fifo(); > > + writew(0x, &i2c_base->stat); > > + } else { > > + /* failure, clear sources*/ > > + writew(0x, &i2c_base->stat); > > + /* finish up xfer */ > > + writew(readw(&i2c_base->con) | I2C_CON_STP, &i2c_base->con); > > + udelay(2); > > here too... are this values from a datasheet? > > If I see this right, we have when probing a not used address, 7 us > timeout ... > > Did you some timing tests between the old and the new version of this driver? These values are based on trial and error methods and not from any datasheet. This delay can be removed. > > [...] > > int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len) > > { > [...] > > + if (i2c_error) { > > + writew(0, &i2c_base->con); > > + return 1; > > + } > > + > > + if (!i2c_error) { > > else ? Else, it would return 1, which is already taken care of. This if loop is not required. I will be deleting this. > > > + writew(I2C_CON_EN, &i2c_base->con); > > + > > + while (readw(&i2c_base->stat) > > + || (readw(&i2c_base->con) & I2C_CON_MST)) { > > + udelay(1); > > + writew(0x, &i2c_base->stat); > > } > > } > > > > + writew(I2C_CON_EN, &i2c_base->con); > > + flush_fifo(); > > + writew(0x, &i2c_base->stat); > > + writew(0, &i2c_base->cnt); > > + > > return 0; > > } > > > > int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int > > len) { > > - int i; > > - u16 status; > > - int i2c_error = 0; > > + int i, i2c_error = 0; > > + u32 status; > > + u16 writelen; > > > > - if (alen > 1) { > > - printf("I2C write: addr len %d not supported\n", alen); > > + if (alen > 2) { > > return 1; > > } > > > > - if (addr + len > 256) { > > - printf("I2C write: address 0x%x + 0x%x out of range\n", > > - addr, len); > > + if (alen < 2) { > > + if (addr + len > 256) { > > + return 1; > > + } > > curly brackets not needed. Yes, I will run a checkpatch and take care in v2. > > [...] > > -static void wait_for_bb(void) > > +static u32 wait_for_bb(void) > > { > > - int timeout = I2C_TIMEOUT; > > - u16 s
Re: [U-Boot] [PATCH 1/2 V2] arm926: Flush the data cache before disabling it.
On Mon Jan 16, 2012 at 10:57:05AM -0700, Tom Rini wrote: > On Fri, Jan 13, 2012 at 10:38 AM, Sughosh Ganu > wrote: > > hi Heiko, > > > > On Fri Jan 13, 2012 at 04:29:29PM +0100, Heiko Schocher wrote: > >> Hello Sugosh, > >> > >> Sughosh Ganu wrote: > >> > hi Christian, > >> > > >> > On Fri Jan 13, 2012 at 09:06:26AM +0100, Christian Riesch wrote: > >> >> Hi Sughosh, > >> >> I had a look at the patch and I tried to understand what's going on > >> >> here (I must confess that I didn't know anything about this cache > >> >> stuff). > >> > > >> > Ok, thanks for taking time off to understand this issue. > >> > > >> >> On Tue, Jan 10, 2012 at 7:12 PM, Sughosh Ganu > >> >> wrote: > >> >>> The current implementation invalidates the cache instead of flushing > >> >>> it. This causes problems on platforms where the spl/u-boot is already > >> >>> loaded to the RAM, with caches enabled by a first stage bootloader. > >> > >> Hmm.. how did u-boot work on such boards? How can u-boot work with D-Cache > >> enabled, if u-boot is not initializing it? (And I think, on davinci SoC > >> we have a none working uboot ethernet driver if d-cache is enabled too). > >> There must be a page_table in DRAM for using D-Cache in U-Boot, if u-boot > >> don't initialize it, it maybe overrides it ... or miss I something? > > > > Well, there is some data in the cache, which if not flushed creates > > problems on my board. I get the board to boot just by commenting out > > cpu_init_crit call. My hypothesis that the D-cache is enabled is > > simply because cache invalidation followed by cache disabling breaks > > the board, while flushing it prior to disabling gets it to boot > > fine. This(invalidation) would not have been a problem if the cache > > was in the disabled state. > > Putting my TI hat on, I've confirmed with the RBL folks that they > aren't turning on ICACHE/DCACHE. Well, i'm not sure then why does the cache invalidation cause a problem on my platform. Btw, will this patch be accepted. Irrespective of the cache state on my board, it is not a wrong fix, and moreover results in the booting of my board. I haven't yet tried out reading the cache bit state in the spl. Will try out this experiment in a day or two, and share the results. -sughosh ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2 V2] arm926: Flush the data cache before disabling it.
Hello Tom, Tom Rini wrote: > On Fri, Jan 13, 2012 at 10:38 AM, Sughosh Ganu > wrote: >> hi Heiko, >> >> On Fri Jan 13, 2012 at 04:29:29PM +0100, Heiko Schocher wrote: >>> Hello Sugosh, >>> >>> Sughosh Ganu wrote: hi Christian, On Fri Jan 13, 2012 at 09:06:26AM +0100, Christian Riesch wrote: > Hi Sughosh, > I had a look at the patch and I tried to understand what's going on > here (I must confess that I didn't know anything about this cache > stuff). Ok, thanks for taking time off to understand this issue. > On Tue, Jan 10, 2012 at 7:12 PM, Sughosh Ganu > wrote: >> The current implementation invalidates the cache instead of flushing >> it. This causes problems on platforms where the spl/u-boot is already >> loaded to the RAM, with caches enabled by a first stage bootloader. >>> Hmm.. how did u-boot work on such boards? How can u-boot work with D-Cache >>> enabled, if u-boot is not initializing it? (And I think, on davinci SoC >>> we have a none working uboot ethernet driver if d-cache is enabled too). >>> There must be a page_table in DRAM for using D-Cache in U-Boot, if u-boot >>> don't initialize it, it maybe overrides it ... or miss I something? >> Well, there is some data in the cache, which if not flushed creates >> problems on my board. I get the board to boot just by commenting out >> cpu_init_crit call. My hypothesis that the D-cache is enabled is >> simply because cache invalidation followed by cache disabling breaks >> the board, while flushing it prior to disabling gets it to boot >> fine. This(invalidation) would not have been a problem if the cache >> was in the disabled state. > > Putting my TI hat on, I've confirmed with the RBL folks that they > aren't turning on ICACHE/DCACHE. That was my thought too, thanks for the clarification! bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm, davinci: add PLL0 prediv to da850 lowlevel setup
Hello Ben, Ben Gardiner wrote: > The OMAP-L138 has a pre-divider available on PLL0. > > Add support to da850_lowlevel.c for configuring PLL0's pre-divider. This is > to achieve certain OPP's -- e.g. the 372MHz OPP used also by Linux. > > Signed-off-by: Ben Gardiner > Cc: Christian Riesch > CC: Heiko Schocher > Cc: Sandeep Paulraj > Cc: Tom Rini > Cc: Albert ARIBAUD > --- > arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c |7 +++ > arch/arm/include/asm/arch-davinci/pll_defs.h|3 ++- > 2 files changed, 9 insertions(+), 1 deletions(-) Acked-by: Heiko Schocher bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 1/9] fdt: Add fdtdec functions to read byte array
On Tuesday 17 January 2012 01:11:14 Simon Glass wrote: > From: Anton Staff > > Sometimes we don't need a full cell for each value. This provides > a simple function to read a byte array, both with and without > copying it. > > Signed-off-by: Simon Glass seems like getting s-o-b from Anton should be fairly easy ;) (there's a few other patches in this series with that problem) -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm, davinci: cam_enc_4xx board updates
Hello tom, Tom Rini wrote: > On Sun, Jan 15, 2012 at 12:59 AM, Heiko Schocher wrote: > > [snip] >> diff --git a/board/ait/cam_enc_4xx/ublimage.cfg >> b/board/ait/cam_enc_4xx/ublimage.cfg >> index 95182ca..2374c72 100644 >> --- a/board/ait/cam_enc_4xx/ublimage.cfg >> +++ b/board/ait/cam_enc_4xx/ublimage.cfg >> @@ -39,7 +39,7 @@ PAGES 6 >> >> # Block number where user bootloader is present >> # RBL starts always with block 1 >> -START_BLOCK5 >> +START_BLOCK0 > > Is the comment here still correct and fully explaining things? It's a > little puzzling when I read it, but I don't have a good handle on the > UBL stuff yet. The line "# RBL starts always with block 1" is missleading. I delete this line! > And aside from expecting a rework of some of this to match Wolfgang's > comments about FIT images, the rest seems fine to me. Thanks for your review! I send an update which handles Wolfgangs FIT comment today. bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V4 1/2] ehci-omap: driver for EHCI host on OMAP3
On Mon, Jan 16, 2012 at 3:27 PM, Stefano Babic wrote: > On 16/01/2012 08:58, Govindraj wrote: > >> Th v2 patch series [1] posted is based on top of this patch. > > If I understand well, we need in any case Ilya's patch. In this case, it > is maybe worth to merge Ilya's patch in the meanwhile (and please drop > my patch that remove USB support from TAM3517 boards). > Yes correct we have to pull in this patch. Tom, Will you be taking this through omap tree? -- Thanks, Govindraj.R ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 7/9] tegra: Add tegra keyboard driver
From: Rakesh Iyer Add support for internal matrix keyboard controller for Nvidia Tegra platforms. This driver uses the fdt decode function to obtain its key codes. Support for the Ctrl modifier is provided. The left and right ctrl keys are dealt with in the same way. This uses the new keyboard input library (drivers/input/input.c) to decode keys and handle most of the common input logic. The intent is to make this driver purely about dealing with the hardware and converting its key matrix into key codes. Key detection before the driver is loaded is supported. This key will be picked up when the keyboard driver is initialized. Modified by Simon Glass for device tree, input layer and various other things. Signed-off-by: Simon Glass --- Changes in v3: - Adjust decode logic to work with new Linux fdt keyboard binding - Use new input library to handle key decode, fifo, getc()/tstc() drivers/input/Makefile|1 + drivers/input/tegra-kbc.c | 536 + include/fdtdec.h |1 + include/tegra-kbc.h | 33 +++ lib/fdtdec.c |1 + 5 files changed, 572 insertions(+), 0 deletions(-) create mode 100644 drivers/input/tegra-kbc.c create mode 100644 include/tegra-kbc.h diff --git a/drivers/input/Makefile b/drivers/input/Makefile index d06acb9..798a2ad 100644 --- a/drivers/input/Makefile +++ b/drivers/input/Makefile @@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk LIB:= $(obj)libinput.o COBJS-$(CONFIG_I8042_KBD) += i8042.o +COBJS-$(CONFIG_TEGRA2_KEYBOARD) += tegra-kbc.o ifdef CONFIG_PS2KBD COBJS-y += keyboard.o pc_keyb.o COBJS-$(CONFIG_PS2MULT) += ps2mult.o ps2ser.o diff --git a/drivers/input/tegra-kbc.c b/drivers/input/tegra-kbc.c new file mode 100644 index 000..1b17f99 --- /dev/null +++ b/drivers/input/tegra-kbc.c @@ -0,0 +1,536 @@ +/* + * (C) Copyright 2011 + * NVIDIA Corporation + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +enum { + KBC_MAX_ROW = 16, + KBC_MAX_COL = 8, + KBC_KEY_COUNT = KBC_MAX_ROW * KBC_MAX_COL, + KBC_MAX_GPIO= 24, + KBC_MAX_KPENT = 8,/* size of keypress entry queue */ +}; + +/* KBC row scan time and delay for beginning the row scan (in usecs) */ +#define KBC_ROW_SCAN_TIME 16 +#define KBC_ROW_SCAN_DLY 5 + +/* uses a 32KHz clock so a cycle = 1/32Khz */ +#define KBC_CYCLE_IN_USEC DIV_ROUND_UP(1000, 32) + +#define KBC_FIFO_TH_CNT_SHIFT(cnt) (cnt << 14) +#define KBC_DEBOUNCE_CNT_SHIFT(cnt)(cnt << 4) +#define KBC_CONTROL_FIFO_CNT_INT_EN(1 << 3) +#define KBC_CONTROL_KBC_EN (1 << 0) +#define KBC_INT_FIFO_CNT_INT_STATUS(1 << 2) +#define KBC_KPENT_VALID(1 << 7) +#define KBC_ST_STATUS (1 << 3) + +#define KBC_RPT_DLY20 +#define KBC_RPT_RATE 4 + +/* keyboard controller config and state */ +static struct keyb { + struct input_config input; + + /* +* Information about keycode mappings. The plain_keycode array must +* exist but fn may be NULL in which case it is not decoded. +*/ + const u8 *plain_keycode;/* key code for each row / column */ + const u8 *fn_keycode; /* ...when Fn held down */ + int fn_pos; /* position of Fn key in key (or -1) */ + + struct kbc_tegra *kbc; /* tegra keyboard controller */ + unsigned char inited; /* 1 if keyboard has been inited */ + unsigned int repoll_time; /* next time to poll keyboard (us) */ + + /* +* After init we must wait a short time before polling the keyboard. +* This gives the tegra keyboard controller time to react after reset +* and lets us grab keys pressed during reset. +*/ + unsigned int init_dly; /* Delay before we can read keyboard */ + unsigned long start_time; /* Time that we inited (in us) */ +} config; + +/** + * Determine if the current keypress configuration can cause key ghosting + * +
[U-Boot] [PATCH v3 3/9] input: Add generic keyboard input handler
Add a module which understands converting key codes (or scan codes) to ASCII characters. It includes FIFO support and can call back to drivers to read new characters when its FIFO is empty. Keycode maps are provided for un-modified, shift and ctrl keys. The plan is to use this module where such mapping is required. Signed-off-by: Simon Glass --- Changes in v3: - Add new patch for generic keyboard input handler drivers/input/Makefile |1 + drivers/input/input.c | 410 include/input.h| 140 3 files changed, 551 insertions(+), 0 deletions(-) create mode 100644 drivers/input/input.c create mode 100644 include/input.h diff --git a/drivers/input/Makefile b/drivers/input/Makefile index 1f4dad3..d06acb9 100644 --- a/drivers/input/Makefile +++ b/drivers/input/Makefile @@ -30,6 +30,7 @@ ifdef CONFIG_PS2KBD COBJS-y += keyboard.o pc_keyb.o COBJS-$(CONFIG_PS2MULT) += ps2mult.o ps2ser.o endif +COBJS-y += input.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c) diff --git a/drivers/input/input.c b/drivers/input/input.c new file mode 100644 index 000..2cf66ed --- /dev/null +++ b/drivers/input/input.c @@ -0,0 +1,410 @@ +/* + * Translate key codes into ASCII + * + * Copyright (c) 2011 The Chromium OS Authors. + * (C) Copyright 2004 DENX Software Engineering, Wolfgang Denk, w...@denx.de + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include +#include + +#include + +enum { + /* These correspond to the lights on the keyboard */ + FLAG_NUM_LOCK = 1 << 0, + FLAG_CAPS_LOCK = 1 << 1, + FLAG_SCROLL_LOCK= 1 << 2, + + /* Special flag ORed with key code to indicate release */ + KEY_RELEASE = 1 << 15, + KEY_MASK= 0xfff, +}; + +/* + * These takes map key codes to ASCII. 0xff means no key, or special key. + * Three tables are provided - one for plain keys, one for when the shift + * 'modifier' key is pressed and one for when the ctrl modifier key is + * pressed. + */ +static const uchar kbd_plain_xlate[] = { + 0xff, 0x1b, '1', '2', '3', '4', '5', '6', + '7', '8', '9', '0', '-', '=', '\b', '\t', /* 0x00 - 0x0f */ + 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', + 'o', 'p', '[', ']', '\r', 0xff, 'a', 's', /* 0x10 - 0x1f */ + 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', + '\'', '`', 0xff, '\\', 'z', 'x', 'c', 'v', /* 0x20 - 0x2f */ + 'b', 'n', 'm', ',' , '.', '/', 0xff, 0xff, 0xff, + ' ', 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,/* 0x30 - 0x3f */ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, '7', + '8', '9', '-', '4', '5', '6', '+', '1', /* 0x40 - 0x4f */ + '2', '3', '0', '.', 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x50 - 0x5F */ + '\r', 0xff, 0xff +}; + +static unsigned char kbd_shift_xlate[] = { + 0xff, 0x1b, '!', '@', '#', '$', '%', '^', + '&', '*', '(', ')', '_', '+', '\b', '\t', /* 0x00 - 0x0f */ + 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', + 'O', 'P', '{', '}', '\r', 0xff, 'A', 'S', /* 0x10 - 0x1f */ + 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', + '"', '~', 0xff, '|', 'Z', 'X', 'C', 'V',/* 0x20 - 0x2f */ + 'B', 'N', 'M', '<', '>', '?', 0xff, 0xff, 0xff, + ' ', 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,/* 0x30 - 0x3f */ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, '7', + '8', '9', '-', '4', '5', '6', '+', '1', /* 0x40 - 0x4f */ + '2', '3', '0', '.', 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x50 - 0x5F */ + '\r', 0xff, 0xff +}; + +static unsigned char kbd_ctrl_xlate[] = { + 0xff, 0x1b, '1', 0x00, '3', '4', '5', 0x1E, + '7', '8', '9', '0', 0x1F, '=', '\b', '\t', /* 0x00 - 0x0f */ + 0x11, 0x17, 0x05, 0x12, 0x14, 0x18, 0x15, 0x09, + 0x0f, 0x10, 0x1b, 0x1d, '\n', 0xff, 0x01, 0x13, /* 0x10 - 0x1f */ + 0x04, 0x06, 0x08, 0x09, 0x0a, 0x0b, 0x0c, ';', + '\'', '~', 0x00, 0x1c, 0x1a, 0x18, 0x03, 0x16, /* 0x20 - 0x2f */ + 0x02, 0x0e, 0x0d, '<', '>', '?', 0xff, 0xff
[U-Boot] [PATCH v3 6/9] tegra: fdt: Add keyboard definitions for Seaboard
From: Anton Staff Seaboard uses a QUERTY keyboard. We add key codes for this to enable key scanning to work. Signed-off-by: Simon Glass --- Changes in v2: - Remove status = "okay" since this is the default anyway Changes in v3: - Move to new Linux device tree mapping for Tegra keyboard board/nvidia/dts/tegra2-seaboard.dts | 27 +++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/board/nvidia/dts/tegra2-seaboard.dts b/board/nvidia/dts/tegra2-seaboard.dts index cc9abe2..a720992 100644 --- a/board/nvidia/dts/tegra2-seaboard.dts +++ b/board/nvidia/dts/tegra2-seaboard.dts @@ -140,4 +140,31 @@ page-spare-bytes = <64>; }; }; + + kbc@7000e200 { + linux,keymap = <0x00020011 0x0003001f 0x0004001e 0x0005002c + 0x000701d0 0x0107007d 0x02060064 0x02070038 0x0306 + 0x03010005 0x03020013 0x03030012 0x03040021 0x03050020 + 0x0306002d 0x0408 0x04010007 0x04020014 0x04030023 + 0x04040022 0x0405002f 0x0406002e 0x04070039 0x050a + 0x05010009 0x05020016 0x05030015 0x05040024 0x05050031 + 0x05060030 0x0507002b 0x060c 0x0601000b 0x06020018 + 0x06030017 0x06040026 0x06050025 0x06060033 0x06070032 + 0x0701000d 0x0702001b 0x0703001c 0x0707008b 0x08040036 + 0x0805002a 0x09050061 0x0907001d 0x0b1a 0x0b010019 + 0x0b020028 0x0b030027 0x0b040035 0x0b050034 0x0c44 + 0x0c010043 0x0c02000e 0x0c030004 0x0c040003 0x0c050067 + 0x0c0600d2 0x0c070077 0x0d6e 0x0d01006f 0x0d030068 + 0x0d04006d 0x0d05006a 0x0d06006c 0x0d070069 0x0e57 + 0x0e010058 0x0e020042 0x0e030010 0x0e04003e 0x0e05003d + 0x0e060002 0x0e070041 0x0f01 0x0f010029 0x0f02003f + 0x0f03000f 0x0f04003b 0x0f05003c 0x0f06003a 0x0f070040 + 0x1447 0x1549 0x15010048 0x1502004b 0x1504004f + 0x16010062 0x1602004d 0x1603004c 0x16040051 0x16050050 + 0x16070052 0x1b010037 0x1b03004a 0x1b04004e 0x1b050053 + 0x1c050073 0x1d030066 0x1d04006b 0x1d0500e0 0x1d060072 + 0x1d0700e1 0x1e45 0x1e010046 0x1e020071 + 0x1f04008a>; + linux,fn-keymap = <0x05040002>; + }; }; -- 1.7.7.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 1/9] fdt: Add fdtdec functions to read byte array
From: Anton Staff Sometimes we don't need a full cell for each value. This provides a simple function to read a byte array, both with and without copying it. Signed-off-by: Simon Glass --- Changes in v2: - Use correct name for get_prop_check_min_len() function include/fdtdec.h | 32 lib/fdtdec.c | 24 2 files changed, 56 insertions(+), 0 deletions(-) diff --git a/include/fdtdec.h b/include/fdtdec.h index 64e2f88..9fd4e38 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -325,3 +325,35 @@ int fdtdec_setup_gpio(struct fdt_gpio_state *gpio); * @return */ int fdtdec_decode_periph_id(const void *blob, int node); + +/* + * Look up a property in a node and return its contents in a byte + * array of given length. The property must have at least enough data for + * the array (count bytes). It may have more, but this will be ignored. + * + * @param blob FDT blob + * @param node node to examine + * @param prop_namename of property to find + * @param arrayarray to fill with data + * @param countnumber of array elements + * @return 0 if ok, or -FDT_ERR_MISSING if the property is not found, + * or -FDT_ERR_BADLAYOUT if not enough data + */ +int fdtdec_get_byte_array(const void *blob, int node, const char *prop_name, + u8 *array, int count); + +/** + * Look up a property in a node and return a pointer to its contents as a + * byte array of given length. The property must have at least enough data + * for the array (count bytes). It may have more, but this will be ignored. + * The data is not copied. + * + * @param blob FDT blob + * @param node node to examine + * @param prop_namename of property to find + * @param countnumber of array elements + * @return pointer to byte array if found, or NULL if the property is not + * found or there is not enough data + */ +const u8 *fdtdec_locate_byte_array(const void *blob, int node, +const char *prop_name, int count); diff --git a/lib/fdtdec.c b/lib/fdtdec.c index db377c7..140310d 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -462,3 +462,27 @@ int fdtdec_decode_periph_id(const void *blob, int node) return cell[1]; } + +int fdtdec_get_byte_array(const void *blob, int node, const char *prop_name, + u8 *array, int count) +{ + const u8 *cell; + int err; + + cell = get_prop_check_min_len(blob, node, prop_name, count, &err); + if (!err) + memcpy(array, cell, count); + return err; +} + +const u8 *fdtdec_locate_byte_array(const void *blob, int node, +const char *prop_name, int count) +{ + const u8 *cell; + int err; + + cell = get_prop_check_min_len(blob, node, prop_name, count, &err); + if (err) + return NULL; + return cell; +} -- 1.7.7.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 9/9] tegra: Enable keyboard for Seaboard
This enables the standard keyboard on Seaboard. Signed-off-by: Simon Glass --- include/configs/seaboard.h |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h index b31ac0c..d2d0115 100644 --- a/include/configs/seaboard.h +++ b/include/configs/seaboard.h @@ -114,4 +114,13 @@ /* Somewhat oddly, the NAND base address must be a config option */ #define CONFIG_SYS_NAND_BASE TEGRA2_NAND_BASE + +/* Enable keyboard */ +#define CONFIG_TEGRA2_KEYBOARD +#define CONFIG_KEYBOARD + +#undef TEGRA2_DEVICE_SETTINGS +#define TEGRA2_DEVICE_SETTINGS "stdin=serial,tegra-kbc\0" \ + "stdout=serial\0" \ + "stderr=serial\0" #endif /* __CONFIG_H */ -- 1.7.7.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 2/9] input: Add linux/input.h for key code support
We want to able to decode Linux fdt keymaps, so bring part of this enormous header file over to U-Boot. Signed-off-by: Simon Glass --- Changes in v3: - Bring in linux/input.h header file in new patch include/linux/input.h | 155 + 1 files changed, 155 insertions(+), 0 deletions(-) create mode 100644 include/linux/input.h diff --git a/include/linux/input.h b/include/linux/input.h new file mode 100644 index 000..44aec76 --- /dev/null +++ b/include/linux/input.h @@ -0,0 +1,155 @@ +/* + * Copyright (c) 1999-2002 Vojtech Pavlik + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + */ + +#ifndef _LINUX_INPUT_H +#define _LINUX_INPUT_H + +/* + * Keys and buttons + * + * Most of the keys/buttons are modeled after USB HUT 1.12 + * (see http://www.usb.org/developers/hidpage). + * Abbreviations in the comments: + * AC - Application Control + * AL - Application Launch Button + * SC - System Control + */ + +#define KEY_RESERVED 0 +#define KEY_ESC1 +#define KEY_1 2 +#define KEY_2 3 +#define KEY_3 4 +#define KEY_4 5 +#define KEY_5 6 +#define KEY_6 7 +#define KEY_7 8 +#define KEY_8 9 +#define KEY_9 10 +#define KEY_0 11 +#define KEY_MINUS 12 +#define KEY_EQUAL 13 +#define KEY_BACKSPACE 14 +#define KEY_TAB15 +#define KEY_Q 16 +#define KEY_W 17 +#define KEY_E 18 +#define KEY_R 19 +#define KEY_T 20 +#define KEY_Y 21 +#define KEY_U 22 +#define KEY_I 23 +#define KEY_O 24 +#define KEY_P 25 +#define KEY_LEFTBRACE 26 +#define KEY_RIGHTBRACE 27 +#define KEY_ENTER 28 +#define KEY_LEFTCTRL 29 +#define KEY_A 30 +#define KEY_S 31 +#define KEY_D 32 +#define KEY_F 33 +#define KEY_G 34 +#define KEY_H 35 +#define KEY_J 36 +#define KEY_K 37 +#define KEY_L 38 +#define KEY_SEMICOLON 39 +#define KEY_APOSTROPHE 40 +#define KEY_GRAVE 41 +#define KEY_LEFTSHIFT 42 +#define KEY_BACKSLASH 43 +#define KEY_Z 44 +#define KEY_X 45 +#define KEY_C 46 +#define KEY_V 47 +#define KEY_B 48 +#define KEY_N 49 +#define KEY_M 50 +#define KEY_COMMA 51 +#define KEY_DOT52 +#define KEY_SLASH 53 +#define KEY_RIGHTSHIFT 54 +#define KEY_KPASTERISK 55 +#define KEY_LEFTALT56 +#define KEY_SPACE 57 +#define KEY_CAPSLOCK 58 +#define KEY_F1 59 +#define KEY_F2 60 +#define KEY_F3 61 +#define KEY_F4 62 +#define KEY_F5 63 +#define KEY_F6 64 +#define KEY_F7 65 +#define KEY_F8 66 +#define KEY_F9 67 +#define KEY_F1068 +#define KEY_NUMLOCK69 +#define KEY_SCROLLLOCK 70 +#define KEY_KP771 +#define KEY_KP872 +#define KEY_KP973 +#define KEY_KPMINUS74 +#define KEY_KP475 +#define KEY_KP576 +#define KEY_KP677 +#define KEY_KPPLUS 78 +#define KEY_KP179 +#define KEY_KP280 +#define KEY_KP381 +#define KEY_KP082 +#define KEY_KPDOT 83 + +#define KEY_ZENKAKUHANKAKU 85 +#define KEY_102ND 86 +#define KEY_F1187 +#define KEY_F1288 +#define KEY_RO 89 +#define KEY_KATAKANA 90 +#define KEY_HIRAGANA 91 +#define KEY_HENKAN 92 +#define KEY_KATAKANAHIRAGANA 93 +#define KEY_MUHENKAN 94 +#define KEY_KPJPCOMMA 95 +#define KEY_KPENTER96 +#define KEY_RIGHTCTRL 97 +#define KEY_KPSLASH98 +#define KEY_SYSRQ 99 +#define KEY_RIGHTALT 100 +#define KEY_LINEFEED 101 +#define KEY_HOME 102 +#define KEY_UP 103 +#define KEY_PAGEUP 104 +#define KEY_LEFT 105 +#define KEY_RIGHT 106 +#define KEY_END107 +#define KE
[U-Boot] [PATCH v3 5/9] tegra: fdt: Add keyboard controller definition
From: Anton Staff The Tegra keyboard controller provides a simple interface to a matrix keyboard. Signed-off-by: Simon Glass --- arch/arm/dts/tegra20.dtsi |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi index 33d6972..3d435aa 100644 --- a/arch/arm/dts/tegra20.dtsi +++ b/arch/arm/dts/tegra20.dtsi @@ -216,4 +216,9 @@ compatible = "nvidia,tegra20-nand"; reg = <0x70008000 0x100>; }; + + kbc@7000e200 { + compatible = "nvidia,tegra20-kbc"; + reg = <0x7000e200 0x0078>; + }; }; -- 1.7.7.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 8/9] tegra: Switch on console mux and use environment for console
All tegra boards will use these options by default. Signed-off-by: Simon Glass --- include/configs/tegra2-common.h |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h index 6c38f51..97ac6cd 100644 --- a/include/configs/tegra2-common.h +++ b/include/configs/tegra2-common.h @@ -133,11 +133,18 @@ #define CONFIG_SYS_NO_FLASH -/* Environment information */ +/* Environment information, boards can override if required */ +#define CONFIG_CONSOLE_MUX +#define CONFIG_SYS_CONSOLE_IS_IN_ENV +#define TEGRA2_DEVICE_SETTINGS "stdin=serial\0" \ + "stdout=serial\0" \ + "stderr=serial\0" + #define CONFIG_EXTRA_ENV_SETTINGS \ "console=ttyS0,115200n8\0" \ "mem=" TEGRA2_SYSMEM "\0" \ "smpflag=smp\0" \ + TEGRA2_DEVICE_SETTINGS #define CONFIG_LOADADDR0x408000/* def. location for kernel */ #define CONFIG_BOOTDELAY 2 /* -1 to disable auto boot */ -- 1.7.7.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 4/9] tegra: Add keyboard support to funcmux
Add funcmux support for the default keyboard mapping. Signed-off-by: Simon Glass --- Changes in v3: - Use funcmux to set up keyboard pinmux arch/arm/cpu/armv7/tegra2/funcmux.c | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/armv7/tegra2/funcmux.c b/arch/arm/cpu/armv7/tegra2/funcmux.c index f84ec74..a5ff890 100644 --- a/arch/arm/cpu/armv7/tegra2/funcmux.c +++ b/arch/arm/cpu/armv7/tegra2/funcmux.c @@ -163,6 +163,22 @@ int funcmux_select(enum periph_id id, int config) } break; + case PERIPH_ID_KBC: + if (config == FUNCMUX_DEFAULT) { + enum pmux_pingrp grp[] = {PINGRP_KBCA, PINGRP_KBCB, + PINGRP_KBCC, PINGRP_KBCD, PINGRP_KBCE, + PINGRP_KBCF}; + int i; + + for (i = 0; i < ARRAY_SIZE(grp); i++) { + pinmux_tristate_disable(grp[i]); + pinmux_set_func(grp[i], PMUX_FUNC_KBC); + pinmux_set_pullupdown(grp[i], PMUX_PULL_UP); + } + + break; + } + default: debug("%s: invalid periph_id %d", __func__, id); return -1; -- 1.7.7.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 0/9] tegra: Enable keyboard with matrix keyboard driver
Tegra2 has a built-in a keyboard controller which we can use to scan a matrix keyboard. This series brings in a driver for this and adds support for the QUERTY keyboard on Seaboard as an example. This version uses the hot-off-the press Tegra keyboard device-tree definition here: http://patchwork.ozlabs.org/patch/134093/ so it should work seemlessly with the kernel keyboard device tree node. Part of this series is an input library which is not tied to Tegra, but hopes to be more generic. It supports converting key codes (or scan codes as they are currently called) into ASCII characters, an input FIFO, multiple key maps and dealing with duplicate key codes under key-repeat situations (when a key is held down). Half of this library is taken from keyboard.c and expanded to keep its state in a structure. The other half of this library is new. If this input library is accepted, then I will update keyboard.c and i8042.c to use it. If not, then I could subsume it into the Tegra driver for now. Or I could do something else. But it didn't seem right to add a third key decoder (ignoring USB which does its own thing). Changes in v2: - Remove status = "okay" since this is the default anyway - Use correct name for get_prop_check_min_len() function Changes in v3: - Add new patch for generic keyboard input handler - Adjust decode logic to work with new Linux fdt keyboard binding - Bring in linux/input.h header file in new patch - Move to new Linux device tree mapping for Tegra keyboard - Use funcmux to set up keyboard pinmux - Use new input library to handle key decode, fifo, getc()/tstc() Anton Staff (3): fdt: Add fdtdec functions to read byte array tegra: fdt: Add keyboard controller definition tegra: fdt: Add keyboard definitions for Seaboard Rakesh Iyer (1): tegra: Add tegra keyboard driver Simon Glass (5): input: Add linux/input.h for key code support input: Add generic keyboard input handler tegra: Add keyboard support to funcmux tegra: Switch on console mux and use environment for console tegra: Enable keyboard for Seaboard arch/arm/cpu/armv7/tegra2/funcmux.c | 16 + arch/arm/dts/tegra20.dtsi|5 + board/nvidia/dts/tegra2-seaboard.dts | 27 ++ drivers/input/Makefile |2 + drivers/input/input.c| 410 ++ drivers/input/tegra-kbc.c| 536 ++ include/configs/seaboard.h |9 + include/configs/tegra2-common.h |9 +- include/fdtdec.h | 33 ++ include/input.h | 140 + include/linux/input.h| 155 ++ include/tegra-kbc.h | 33 ++ lib/fdtdec.c | 25 ++ 13 files changed, 1399 insertions(+), 1 deletions(-) create mode 100644 drivers/input/input.c create mode 100644 drivers/input/tegra-kbc.c create mode 100644 include/input.h create mode 100644 include/linux/input.h create mode 100644 include/tegra-kbc.h -- 1.7.7.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/4] ehci-omap: Clean up added ehci-omap.c
On Thu, Jan 12, 2012 at 4:22 PM, Govindraj wrote: > On Thu, Jan 12, 2012 at 2:53 PM, Igor Grinberg > wrote: >> Hi Govindraj, >> >> On 01/12/12 07:45, Govindraj wrote: >>> Hi Igor, >>> >>> On Wed, Jan 11, 2012 at 8:33 PM, Igor Grinberg >>> wrote: Hi Guys, On 01/11/12 16:34, Marek Vasut wrote: >> On Wed, Jan 11, 2012 at 6:58 PM, Marek Vasut >> wrote: On Wed, Jan 11, 2012 at 6:16 PM, Marek Vasut wrote: >> On Wed, Jan 11, 2012 at 4:22 PM, Marek Vasut > wrote: Hi Marek, Thanks for you review. On Tue, Jan 10, 2012 at 9:37 PM, Marek Vasut >>> >>> wrote: >> From: "Govindraj.R" >> >> Clean up added ehci-omap.c and make it generic for re-use >> across soc having same ehci ip block. Also pass the modes to >> be configured and configure the ports accordingly. All usb >> layers are not cache aligned till then keep cache off for usb >> ops as ehci will use internally dma for all usb ops. >> >> * Add a generic common header ehci-omap.h having common ip >> block data and reg shifts. >> * Rename and modify ehci-omap3 to ehci.h retain only >> conflicting sysc reg shifts remove others and move to common >> header file. > > Don't reimplement the ulpi stuff ... there's already some ulpi > stuff in uboot that needs fixing, so fix it and use it. I am not implementing any ulpi stuff I am just configuring OMAP on soc usb host controller (ehci). All the configuration stuff is OMAP specific things which are done in ehci-omap.c file stuffs done are like soft-reset, port mode to be used and putting port in no -idle mode(omap specific pm implementation) etc. >>> >>> This stuff: >>> >>> +/* ULPI */ >>> +#define ULPI_SET(a) (a + 1) >>> +#define ULPI_CLR(a) (a + 2) >>> +#define ULPI_FUNC_CTRL 0x04 >>> +#define ULPI_FUNC_CTRL_RESET (1 << 5) >>> >>> is just accidentally conforming to ULPI spec? >> >> These are for configuring INSNREG05_ULPI reg in EHCI reg map >> of omap while configuring in ulpi-phy mode. >> >> looking into struct ulpi_regs {..} >> then it doesn't map this configuration. > > Can you point me to some documentation about this please? It's not > that I don't trust you, I'd rather prefer to avoid unnecessary > duplication. Yes that would be fine. You can download the omap4460 public trm from here: http://www.ti.com/pdfs/wtbu/OMAP4460_ES.1x_PUBLIC_TRM_vM.zip Go to chapter 23.11.6.6.1 EHCI Register Summary (page number 5171 and 5186/87) >>> >>> Sure, but the macro above looks more like 23.11.6.3, doesn't it ? And >>> for >>> that purpose, the struct ulpi_regs is fitting ok. >>> >>> Actually ... can you check the ulpi_read and ulpi_write stuff that's >>> already in u-boot and explain why they can not be used with this port? >> >> echi-omap.c is no where writing to those registers >> and the macro was used only to configure INSNREG05_ULPI reg in EHCI reg >> map >> >> reg map in 23.11.6.3 used only for a external ulpi-phy communication. >> and debug purpose(to view vid, pid etc) and to hack external phy >> configuration through ulpi commands >> from omap - usb host controller point of view only needs >> INSNREG05_ULPI reg in EHCI reg configuration >> rest on soc host controller takes care of it. > > Can someone else comment on this? I think I don't understand well (as I'm > not > OMAP guy). Well, it is on my list, actually, but I will be able to get to it only in a couple of days. (I'm really busy right now). >>> >>> Could you please let me know what exactly that you will be >>> updating? >>> >>> So that I can accordingly post my v3 of this patch fixing comments >>> from Marek Vasut >> >> Well, I did not say, I'm going to update anything. >> What I meant is that I'm going to look into TI's documentation >> regarding EHCI and the ULPI to understand the dependencies and see >> how your code meets those and if the generic ULPI layer can be used >> for that. >> > > okay, Thanks, > >> So to lower the work load from from you, I'd suggest you to wait >> till Monday (if you can of course) to let me look into this. > Gentle Ping. And just to clarify further there is no code duplication for ulpi read writes in ehci-omap.c done with this
Re: [U-Boot] [RFC PATCH v2 0/28] Create generic board init for ARM, x86, PPC
Hi, On Fri, Jan 6, 2012 at 4:24 PM, Simon Glass wrote: > This series creates a generic board.c implementation which contains > the essential functions of the major arch/xxx/lib/board.c files. I haven't had huge numbers of comments on this series, but there are a few. I plan to tidy these up and resubmit, dropping the RFC tag, sometime this week. Any patches / fixes to make this run properly on x86 / PPC would be gratefully accepted. Regards, Simon > > What is the motivation for this change? > > 1. There is a lot of repeated code in the board.c files. Any change to > things like setting up the baud rate requires a change in 10 separate > places. > > 2. Since there are 10 separate files, adding a new feature which requires > initialisation is painful since it must be independently added in 10 > places. > > 3. As time goes by the architectures naturely diverge since there is limited > pressure to compare features or even CONFIG options against simiilar things > in other board.c files. > > 4. New architectures must implement all the features all over again, and > sometimes in subtley different ways. This places an unfair burden on getting > a new architecture fully functional and running with U-Boot. > > 5. While it is a bit of a tricky change, I believe it is worthwhile and > achievable. There is no requirement that all code be common, only that > the code that is common should be located in common/board.c rather than > arch/xxx/lib/board.c. > > All the functions of board_init_f() and board_init_r() are broken into > separate function calls so that they can easily be included or excluded > for a particular architecture. It also makes it easier to adopt Graeme's > initcall proposal when it is ready. > > http://lists.denx.de/pipermail/u-boot/2012-January/114499.html > > This series removes the dependency on generic relocation. So relocation > happens as one big chunk and is still completely arch-specific. See the > relocation series for a proposed solution to this for ARM: > > http://lists.denx.de/pipermail/u-boot/2011-December/112928.html > > or Graeme's recent x86 series v2: > > http://lists.denx.de/pipermail/u-boot/2012-January/114467.html > > Instead of moving over a whole architecture, this series takes the approach > of simply enabling generic board support for an architecture. It is then up > to each board to opt in by defining CONFIG_SYS_GENERIC_BOARD in the board > config file. If this is not done, then the code will be generated as > before. This allows both sets of code to co-exist until we are comfortable > with the generic approach, and enough boards run. > > ARM is a relatively large board.c file and one which I can test, therefore > I think it is a good target for this series. On the other hand, x86 is > relatively small and simple, but different enough that it introduces a > few issues to be solved. So I have chosen both ARM and x86 for this series. > After a suggestion from Wolfgang I have added PPC also. This is the > largest and most feature-full board, so hopefully we have all bases > covered in this RFC. > > A generic global_data structure is also required. This might upset a few > people. Here is my basic reasoning: most fields are the same, all > architectures include and need it, most global_data.h files already have > #ifdefs to select fields for a particular SOC, so it is hard to > see why architecures are different in this area. We can perhaps add a > way to put architecture-specific fields into a separate header file, but > for now I have judged that to be counter-productive. > > Similarly we need a generic bd_info structure, since generic code will > be accessing it. I have done this in the same way as global_data and the > same comments apply. > > There was dicussion on the list about passing gd_t around as a parameter > to pre-relocation init functions. I think this makes sense, but it can > be done as a separate change, and this series does not require it. > > While this series needs to stand on its own (as with the link script > cleanup series and the generic relocation series) the goal is the > unification of the board init code. So I hope we can address issues with > this in mind, rather than focusing too narrowly on particular ARM, x86 or > PPC issues. > > I have run-tested ARM on Tegra Seaboard only. To try it out, define > CONFIG_SYS_GENERIC_BOARD in your board file and rebuild. Most likely on > x86 and PPC at least it will hang, but if you are lucky it will print > something first :-) > > I have run this though MAKEALL with CONFIG_SYS_GENERIC_BOARD on for all > ARM, PPC and x86 boards. There are a few failures, some due to errors in > the board config, some due to things that need fixing. I will address > these with the final series if required. > > Note: the first group of commits are required for this series to build, > but could be separated out if required. I have included them here for > convenience. > > Comments welcome. > > Changes in v2: > - Change generic b
[U-Boot] Uboot for PowerPC MPC8313
Hi, We are developing application at PowerPC MPC8313E. For testing of peripherals at power on of the device, we are using U-boot Version – 1.1.6). This is an old project and we are only upgrading few of the functionalities. The reason I have contacted you is, I’m trying to test UART3 (it’s a memory mapped IO, driven from a eLBC module via chip selection and all). Somehow I’m not able to test from the u-boot how to test this memory mapped IO. I’m looking to transmit and receive few character to HyperTerminal and conclude whether its working or not? My questions are 1. Is it possible to test this UART (memory mapped IO) in such a manner? 2. If yes, can u guide me how to test with some reference code or something? We have been struck here for a week and tried everything but I think somewhere I’m lacking proper guidance (1st time I’m developing something on Linux and powerPC) Thanks for any suggestion.. Regards, Ankur Singh Larsen & Toubro Limited www.larsentoubro.com This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] mx28: fix i.MX28 spi driver
> On 01/14/2012 03:10 PM, Marek Vasut wrote: > >> The generic spi flash driver (drivers/mtd/spi/spi_flash.c) uses the > >> spi low level driver's spi_xfer() function with len=0 to deassert the > >> SPI flash' chip select. But the i.MX28 spi driver rejects this call > >> due to len=0. > >> > >> This patch implements an exception for len=0 with the SPI_XFER_END > >> flag set. This results in an extra read with the chip select being > >> deasserted afterwards. There seems to be no way to deassert the signal > >> by hand. > > > > This seems good, but it doesn't look too correct either (is there really > no > > other way to deassert CS than doing dummy read?). > Not that I am aware of. Did you wrote that mxs_spi driver? How did you > interpret the > chips reference manual. I understood it this way: you need to tell the > controller > to deassert chip select before the final transfer. > > I could be possible to change the driver implementation and use GPIOs for > chip select. But I think that's not the philisophy of this controller. > > > Do you see an issue with > > current implementation on some board please? > Yes, I installed an SST25VF032B SPI on the MX28EVK in preparation of our > own board. The chip was detected correctly after power on, but erasing > (that's one place where the status register polling is used) more than one > page > does not work and then after reset the device is not correctly detected. > > I would expect problems on the M28EVK (Denx) also. You might want to turn > SPI + spi_flash debugging to see it. Also I found a posting from > Alexander Keller on the u-boot list from 12/13/2011. Perhaps the can check I just want to confirm and thanks to Matthias for this patch. I already stated my problems by writing the SPI flash ... So, I use the IMX28EVK with a Winbond W25Q64CV SPI flash chip and it's working great now. Thanks for the great work. Alexander > if > this patch fixes his problems also. > > Matthias > > > >> > >> Signed-off-by: Matthias Fuchs > >> --- > >> drivers/spi/mxs_spi.c | 12 +--- > >> 1 files changed, 9 insertions(+), 3 deletions(-) > >> > >> diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c > >> index 4c27fef..adb9ca8 100644 > >> --- a/drivers/spi/mxs_spi.c > >> +++ b/drivers/spi/mxs_spi.c > >> @@ -129,9 +129,15 @@ int spi_xfer(struct spi_slave *slave, unsigned int > >> bitlen, int len = bitlen / 8; > >>const char *tx = dout; > >>char *rx = din; > >> - > >> - if (bitlen == 0) > >> - return 0; > >> + char dummy; > >> + > >> + if (bitlen == 0) { > >> + if (flags & SPI_XFER_END) { > >> + rx = &dummy; > >> + len = 1; > >> + } else > >> + return 0; > >> + } > >> > >>if (!rx && !tx) > >>return 0; > > ___ > > U-Boot mailing list > > U-Boot@lists.denx.de > > http://lists.denx.de/mailman/listinfo/u-boot > > > -- > - > Dipl.-Ing. Matthias Fuchs > Head of System Design > > esd electronic system design gmbh > Vahrenwalder Str. 207 - 30165 Hannover - GERMANY > Phone: +49-511-37298-0 - Fax: +49-511-37298-68 > Please visit our homepage http://www.esd.eu > Quality Products - Made in Germany > - > Geschäftsführer: Klaus Detering > Amtsgericht Hannover HRB 51373 - VAT-ID DE 115672832 > - ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] net: punt bd->bi_ip_addr
This field gets read in one place (by "bdinfo"), and we can replace that with getenv("ipaddr"). After all, the bi_ip_addr field is kept up-to-date implicitly with the value of the ipaddr env var. Signed-off-by: Mike Frysinger --- arch/arm/include/asm/u-boot.h|1 - arch/arm/lib/board.c |3 --- arch/avr32/include/asm/u-boot.h |1 - arch/avr32/lib/board.c |2 -- arch/blackfin/include/asm/u-boot.h |1 - arch/blackfin/lib/board.c|3 --- arch/m68k/include/asm/u-boot.h |1 - arch/m68k/lib/board.c|9 - arch/microblaze/include/asm/u-boot.h |1 - arch/microblaze/lib/board.c |3 --- arch/mips/include/asm/u-boot.h |1 - arch/mips/lib/board.c|3 --- arch/nds32/include/asm/u-boot.h |1 - arch/nds32/lib/board.c |3 --- arch/nios2/include/asm/u-boot.h |1 - arch/nios2/lib/board.c |2 -- arch/openrisc/include/asm/u-boot.h |1 - arch/powerpc/include/asm/u-boot.h|1 - arch/powerpc/lib/board.c |3 --- arch/sandbox/include/asm/u-boot.h|1 - arch/sandbox/lib/board.c |3 --- arch/sh/include/asm/u-boot.h |1 - arch/sh/lib/board.c | 11 --- arch/sparc/include/asm/u-boot.h |1 - arch/sparc/lib/board.c |2 -- arch/x86/include/asm/u-boot.h|1 - arch/x86/lib/board.c |6 -- board/esd/cpci405/cpci405.c |9 - common/cmd_bdinfo.c | 28 ++-- common/cmd_nvedit.c | 16 +--- net/net.c|2 -- 31 files changed, 19 insertions(+), 103 deletions(-) diff --git a/arch/arm/include/asm/u-boot.h b/arch/arm/include/asm/u-boot.h index f30b9fc..e6b3e46 100644 --- a/arch/arm/include/asm/u-boot.h +++ b/arch/arm/include/asm/u-boot.h @@ -38,7 +38,6 @@ typedef struct bd_info { intbi_baudrate;/* serial console baudrate */ -unsigned long bi_ip_addr; /* IP Address */ ulong bi_arch_number; /* unique id for this board */ ulong bi_boot_params; /* where this board expects params */ struct /* RAM configuration */ diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index 3d78274..e611ada 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -536,9 +536,6 @@ void board_init_r(gd_t *id, ulong dest_addr) arm_pci_init(); #endif - /* IP Address */ - gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr"); - stdio_init(); /* get the devices list going. */ jumptable_init(); diff --git a/arch/avr32/include/asm/u-boot.h b/arch/avr32/include/asm/u-boot.h index ff1ed23..1d2959a 100644 --- a/arch/avr32/include/asm/u-boot.h +++ b/arch/avr32/include/asm/u-boot.h @@ -24,7 +24,6 @@ typedef struct bd_info { unsigned long bi_baudrate; - unsigned long bi_ip_addr; unsigned char bi_phy_id[4]; unsigned long bi_board_number; void*bi_boot_params; diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c index 63fe297..be5da90 100644 --- a/arch/avr32/lib/board.c +++ b/arch/avr32/lib/board.c @@ -304,8 +304,6 @@ void board_init_r(gd_t *new_gd, ulong dest_addr) /* initialize environment */ env_relocate(); - bd->bi_ip_addr = getenv_IPaddr ("ipaddr"); - stdio_init(); jumptable_init(); console_init_r(); diff --git a/arch/blackfin/include/asm/u-boot.h b/arch/blackfin/include/asm/u-boot.h index 9712fc0..df81183 100644 --- a/arch/blackfin/include/asm/u-boot.h +++ b/arch/blackfin/include/asm/u-boot.h @@ -30,7 +30,6 @@ typedef struct bd_info { int bi_baudrate;/* serial console baudrate */ - unsigned long bi_ip_addr; /* IP Address */ unsigned long bi_boot_params; /* where this board expects params */ unsigned long bi_memstart; /* start of DRAM memory */ phys_size_t bi_memsize; /* size of DRAM memory in bytes */ diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c index e3ee4cd..5d9d448 100644 --- a/arch/blackfin/lib/board.c +++ b/arch/blackfin/lib/board.c @@ -86,7 +86,6 @@ static void display_global_data(void) printf(" |-jt(%p): %p\n", gd->jt, *(gd->jt)); printf(" \\-bd: %p\n", gd->bd); printf(" |-bi_baudrate: %x\n", bd->bi_baudrate); - printf(" |-bi_ip_addr: %lx\n", bd->bi_ip_addr); printf(" |-bi_boot_params: %lx\n", bd->bi_boot_params); printf(" |-bi_memstart: %lx\n", bd->bi_memstart); printf(" |-bi_memsize: %lx\n", bd->bi_memsize); @@ -299,8 +298,6 @@ static void board_net_init_r(bd_t *bd) if ((s = getenv("bootfile")) != NULL)
[U-Boot] [PATCH 2/2] net: move bootfile init into eth_initialize
All arches init this the same way, so move the logic into the core net code to avoid duplicating it everywhere else. Signed-off-by: Mike Frysinger --- arch/arm/lib/board.c|8 arch/avr32/lib/board.c |3 --- arch/blackfin/lib/board.c |7 +-- arch/m68k/lib/board.c |5 - arch/microblaze/lib/board.c |4 arch/mips/lib/board.c |8 arch/nds32/lib/board.c |6 -- arch/powerpc/lib/board.c|8 arch/sh/lib/board.c | 11 ++- arch/sparc/lib/board.c |5 - arch/x86/lib/board.c|6 -- net/eth.c | 10 ++ 12 files changed, 13 insertions(+), 68 deletions(-) diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index e611ada..2c4276b 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -573,14 +573,6 @@ void board_init_r(gd_t *id, ulong dest_addr) /* Initialize from environment */ load_addr = getenv_ulong("loadaddr", 16, load_addr); -#if defined(CONFIG_CMD_NET) - { - char *s = getenv("bootfile"); - - if (s != NULL) - copy_filename(BootFile, s, sizeof(BootFile)); - } -#endif #ifdef CONFIG_BOARD_LATE_INIT board_late_init(); diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c index be5da90..4bc3c8a 100644 --- a/arch/avr32/lib/board.c +++ b/arch/avr32/lib/board.c @@ -315,9 +315,6 @@ void board_init_r(gd_t *new_gd, ulong dest_addr) bb_miiphy_init(); #endif #if defined(CONFIG_CMD_NET) - s = getenv("bootfile"); - if (s) - copy_filename(BootFile, s, sizeof(BootFile)); puts("Net: "); eth_initialize(gd->bd); #endif diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c index 5d9d448..1ee7e22 100644 --- a/arch/blackfin/lib/board.c +++ b/arch/blackfin/lib/board.c @@ -293,13 +293,8 @@ static void board_net_init_r(bd_t *bd) bb_miiphy_init(); #endif #ifdef CONFIG_CMD_NET - char *s; - - if ((s = getenv("bootfile")) != NULL) - copy_filename(BootFile, s, sizeof(BootFile)); - printf("Net: "); - eth_initialize(gd->bd); + eth_initialize(bd); #endif } diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c index e80d853..b3dca77 100644 --- a/arch/m68k/lib/board.c +++ b/arch/m68k/lib/board.c @@ -559,11 +559,6 @@ void board_init_r (gd_t *id, ulong dest_addr) /* Initialize from environment */ load_addr = getenv_ulong("loadaddr", 16, load_addr); -#if defined(CONFIG_CMD_NET) - if ((s = getenv ("bootfile")) != NULL) { - copy_filename (BootFile, s, sizeof (BootFile)); - } -#endif WATCHDOG_RESET (); diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c index beb406d..f3679d5 100644 --- a/arch/microblaze/lib/board.c +++ b/arch/microblaze/lib/board.c @@ -182,10 +182,6 @@ void board_init (void) uchar enetaddr[6]; eth_getenv_enetaddr("ethaddr", enetaddr); printf("MAC: %pM\n", enetaddr); - - s = getenv("bootfile"); - if (s != NULL) - copy_filename(BootFile, s, sizeof(BootFile)); #endif /* main_loop */ diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c index 2f45562..6b36a98 100644 --- a/arch/mips/lib/board.c +++ b/arch/mips/lib/board.c @@ -335,14 +335,6 @@ void board_init_r(gd_t *id, ulong dest_addr) /* Initialize from environment */ load_addr = getenv_ulong("loadaddr", 16, load_addr); -#if defined(CONFIG_CMD_NET) - { - char *s = getenv("bootfile"); - - if (s != NULL) - copy_filename(BootFile, s, sizeof(BootFile)); - } -#endif #ifdef CONFIG_CMD_SPI puts("SPI: "); diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c index 46f022a..446e0fd 100644 --- a/arch/nds32/lib/board.c +++ b/arch/nds32/lib/board.c @@ -398,12 +398,6 @@ void board_init_r(gd_t *id, ulong dest_addr) /* Initialize from environment */ load_addr = getenv_ulong("loadaddr", 16, load_addr); -#if defined(CONFIG_CMD_NET) - s = getenv("bootfile"); - if (s != NULL) - copy_filename(BootFile, s, sizeof(BootFile)); -#endif - #ifdef BOARD_LATE_INIT board_late_init(); #endif diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c index d4cbb4d..931b098 100644 --- a/arch/powerpc/lib/board.c +++ b/arch/powerpc/lib/board.c @@ -932,14 +932,6 @@ void board_init_r(gd_t *id, ulong dest_addr) /* Initialize from environment */ load_addr = getenv_ulong("loadaddr", 16, load_addr); -#if defined(CONFIG_CMD_NET) - { - char *s = getenv("bootfile"); - - if (s != NULL) - copy_filename(BootFile, s, sizeof(BootFile)); - } -#endif WATCHDOG_RESET(); diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c index cb
Re: [U-Boot] [PATCH] net/eth.c: fix eth_write_hwaddr() to use dev->enetaddr as fall back
This patch will also fix a problem with mx28 boards that are depending on the OCOTP bits to set the MAC address (like the Denx m28 board). Now it simply fails with a "Warning: failed to set MAC address" if there's no environment variable instead of using the OCOTP bits like it should. This patch will fix that. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] net: move bootfile/ipaddr init into eth_initialize
On Monday 16 January 2012 06:18:26 Wolfgang Denk wrote: > Mike Frysinger wrote: > > > The code which you remove here does NOT depend on CONFIG_CMD_NET; > > > note that this is intentional. > > > > i noticed that, however, i'm not sure it matters. i can't find any place > > in u- boot that actually reads this variable. > > For example, the "bdinfo" command prints it; see common/cmd_bdinfo.c which i documented as the *only* place where the member gets read: common/cmd_bdinfo.c: the value of bi_ip_addr gets displayed and that would be absolutely trivial to replace with getenv("ipaddr") -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/5] i.mx6q: mx6qsabrelite: Update the network configuration
On 1/16/2012 6:48 AM, Jason Hui wrote: On Fri, Jan 13, 2012 at 8:10 PM, Dirk Behme wrote: From: Troy Kisky Enable the usage of PHY_MICREL_KSZ9021, force the master mode and minimize the tx clock delay. There is an issue with the gigabit ethernet mode at the SabreLite boards: When operating on a Gb LAN, the FEC occasionally receives packets larger than the MTU that appear to be caused by concatenation of multiple received packets into one. No, the extra length are usually zero bytes. The problem was identified on the phy side. The current schematic has the center tap pin 9 of the MAG/JAC USB combo to 3.3 filtered supply. Letting this pin float solves the problem. Signed-off-by: Troy Kisky CC: Troy Kisky CC: Stefano Babic CC: Jason Liu Dirk should either signoff or ack --- Note: This patch depends on the basic SabreLite ethernet patch http://patchwork.ozlabs.org/patch/135744/ board/freescale/mx6qsabrelite/mx6qsabrelite.c |8 ++-- include/configs/mx6qsabrelite.h |1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index d80165e..7879049 100644 --- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c +++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c @@ -193,13 +193,17 @@ int board_mmc_init(bd_t *bis) int fecmxc_mii_postcall(int phy) { - /* prefer master mode */ - miiphy_write("FEC", phy, MII_1000BASET_CTRL, 0x0f00); + /* force master mode */ + miiphy_write("FEC", phy, MII_1000BASET_CTRL, 0x1f00); /* min rx data delay */ miiphy_write("FEC", phy, MII_EXTENDED_CTRL, 0x8105); miiphy_write("FEC", phy, MII_EXTENDED_DATAW, 0x); + /* min tx data delay */ + miiphy_write("FEC", phy, MII_EXTENDED_CTRL, 0x8106); + miiphy_write("FEC", phy, MII_EXTENDED_DATAW, 0x); + /* max rx/tx clock delay, min rx/tx control delay */ miiphy_write("FEC", phy, MII_EXTENDED_CTRL, 0x8104); miiphy_write("FEC", phy, MII_EXTENDED_DATAW, 0xf0f0); diff --git a/include/configs/mx6qsabrelite.h b/include/configs/mx6qsabrelite.h index 840e271..6a29142 100644 --- a/include/configs/mx6qsabrelite.h +++ b/include/configs/mx6qsabrelite.h @@ -66,6 +66,7 @@ #defineCONFIG_FEC_XCV_TYPE RGMII #define CONFIG_ETHPRIME"FEC" #define CONFIG_FEC_MXC_PHYADDR 6 +#define CONFIG_PHY_MICREL_KSZ9021 Acked-by: Jason Liu /* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE -- 1.7.0.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] nand/fsl_elbc: Convert to self-init
On Monday 16 January 2012 15:03:37 Scott Wood wrote: > On 01/16/2012 01:58 PM, Mike Frysinger wrote: > > On Monday 16 January 2012 11:51:14 Scott Wood wrote: > >> On 01/15/2012 01:29 PM, Mike Frysinger wrote: > >>> On Thursday 12 January 2012 20:59:41 Scott Wood wrote: > --- a/drivers/mtd/nand/fsl_elbc_nand.c > +++ b/drivers/mtd/nand/fsl_elbc_nand.c > > +#ifndef CONFIG_SYS_NAND_BASE_LIST > +#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE } > +#endif > >>> > >>> would this be better off in nand.h ? > >> > >> I'm trying to get away from the model where the NAND subsystem pretends > >> to know anything about how a driver talks to its hardware (except when > >> the driver chooses to use a common NAND function that uses things like > >> IO_ADDR_R/W). For eLBC it probably makes more sense to specify the > >> chipselect rather than the address (we have to search for the former > >> based on the latter), though that's a separate change that can happen on > >> its own now that the connection to subsystem code has been severed. > > > > so the idea would be to let CONFIG_SYS_NAND_BASE_LIST and > > CONFIG_SYS_NAND_BASE die for devices that could care less ? > > Yes. ok ... no complaints from me then ;) > > and eventually obsolete CONFIG_SYS_MAX_NAND_DEVICE ? > > This is harder, as we still have a notion of an array of enumerated NAND > devices in the command line code. sure, it'll require some more plumbing to make happen -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2] edminiv2: add hush parser, cmdline editing and long help
Signed-off-by: Albert ARIBAUD --- Patch history: V2: include cmdline editing, forgotten in V1 include/configs/edminiv2.h | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/include/configs/edminiv2.h b/include/configs/edminiv2.h index 88d32b2..988d045 100644 --- a/include/configs/edminiv2.h +++ b/include/configs/edminiv2.h @@ -221,6 +221,16 @@ #define CONFIG_SYS_RESET_ADDRESS 0x #define CONFIG_SYS_MAXARGS 16 +/* Use the HUSH parser */ +#define CONFIG_SYS_HUSH_PARSER +#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " + +/* Enable command line editing */ +#define CONFIG_CMDLINE_EDITING + +/* provide extensive help */ +#define CONFIG_SYS_LONGHELP + /* additions for new relocation code, must be added to all boards */ #define CONFIG_SYS_SDRAM_BASE 0 #define CONFIG_SYS_INIT_SP_ADDR\ -- 1.7.5.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RESEND PATCH v3 5/6] arm: Move over to generic relocation
Add a function to process a single ELF relocation and switch ARM over to use generic relocation. Unfortunately a few boards need to be modified to make this work (mostly adding link symbols to the .lds files). Signed-off-by: Simon Glass --- Changes in v2: - Use an inline relocation function to reduce code size arch/arm/config.mk |3 - arch/arm/include/asm/reloc.h| 56 +++ nand_spl/board/freescale/mx31pdk/Makefile |8 +++- nand_spl/board/freescale/mx31pdk/u-boot.lds |1 + nand_spl/board/karo/tx25/Makefile |8 +++- nand_spl/board/karo/tx25/u-boot.lds |1 + 6 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 arch/arm/include/asm/reloc.h diff --git a/arch/arm/config.mk b/arch/arm/config.mk index f47d4f7..45f9dca 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -81,6 +81,3 @@ endif ifndef CONFIG_NAND_SPL LDFLAGS_u-boot += -pie endif - -# We use legacy relocation for now -CONFIG_SYS_SKIP_RELOC := y diff --git a/arch/arm/include/asm/reloc.h b/arch/arm/include/asm/reloc.h new file mode 100644 index 000..3b6491d --- /dev/null +++ b/arch/arm/include/asm/reloc.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include +#include + +/** + * Process a single ELF relocation entry + * + * @param addr Pointer to address of intruction/data to relocate + * @param info The ELF information word / flags + * @param symtab The ELF relocation symbol table + * @param reloc_offOffset of relocated U-Boot relative to load address + * @return 0 if ok, -1 on error + */ +static inline int arch_elf_relocate_entry(Elf32_Addr *addr, Elf32_Word info, + Elf32_Sym *symtab, ulong reloc_off) +{ + int sym; + + switch (ELF32_R_TYPE(info)) { + /* relative fix: increase location by offset */ + case 23: /* TODO: add R_ARM_... defines to elf.h */ + *addr += reloc_off; + break; + + /* absolute fix: set location to (offset) symbol value */ + case 2: + sym = ELF32_R_SYM(info); + *addr = symtab[sym].st_value + reloc_off; + break; + + default: + debug("*** Invalid relocation\n"); + return -1; + } + return 0; +} diff --git a/nand_spl/board/freescale/mx31pdk/Makefile b/nand_spl/board/freescale/mx31pdk/Makefile index 87784d2..470e320 100644 --- a/nand_spl/board/freescale/mx31pdk/Makefile +++ b/nand_spl/board/freescale/mx31pdk/Makefile @@ -11,7 +11,7 @@ LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \ AFLAGS += -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL CFLAGS += -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL -SOBJS = start.o lowlevel_init.o +SOBJS = start.o lowlevel_init.o proc.o reloc.o COBJS = nand_boot_fsl_nfc.o SRCS := $(SRCTREE)/nand_spl/nand_boot_fsl_nfc.c @@ -50,6 +50,12 @@ $(obj)%.o: $(SRCTREE)/board/freescale/mx31pdk/%.S $(obj)%.o: $(SRCTREE)/nand_spl/%.c $(CC) $(CFLAGS) -c -o $@ $< +$(obj)%.o: $(SRCTREE)/common/%.c + $(CC) $(CFLAGS) -c -o $@ $< + +$(obj)%.o: $(SRCTREE)/arch/arm/lib/%.S + $(CC) $(AFLAGS) -c -o $@ $< + # defines $(obj).depend target include $(SRCTREE)/rules.mk diff --git a/nand_spl/board/freescale/mx31pdk/u-boot.lds b/nand_spl/board/freescale/mx31pdk/u-boot.lds index d2b08f6..2273e9b 100644 --- a/nand_spl/board/freescale/mx31pdk/u-boot.lds +++ b/nand_spl/board/freescale/mx31pdk/u-boot.lds @@ -51,6 +51,7 @@ SECTIONS __u_boot_cmd_end = .; . = ALIGN(4); + __image_copy_end = .; .rel.dyn : { __rel_dyn_start = .; diff --git a/nand_spl/board/karo/tx25/Makefile b/nand_spl/board/karo/tx25/Makefile index 0336346..cac5600 100644 --- a/nand_spl/board/karo/tx25/Makefile +++ b/nand_spl/board/karo/tx25/Makefile @@ -32,7 +32,7 @@ LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \ AFLAGS += -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL CFLAGS += -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL -SOBJS = start.o lowlevel_init.o +SOBJS = start.o lowle
[U-Boot] [RESEND PATCH v3 1/6] Create reloc.h and include it where needed
Before adding new relocation functions, move this prototype out of common.h where things are pretty crowded. Signed-off-by: Simon Glass --- arch/arm/cpu/arm926ejs/davinci/spl.c |1 + arch/arm/cpu/armv7/omap-common/spl.c |1 + arch/arm/lib/board.c |1 + arch/avr32/lib/board.c|1 + arch/m68k/lib/board.c |1 + arch/mips/lib/board.c |1 + arch/nds32/lib/board.c|1 + arch/powerpc/lib/board.c |1 + arch/x86/lib/board.c |1 + board/freescale/mpc8313erdb/mpc8313erdb.c |1 + board/freescale/mpc8315erdb/mpc8315erdb.c |1 + board/samsung/smdk6400/smdk6400_nand_spl.c|1 + board/sheldon/simpc8313/simpc8313.c |1 + include/common.h |2 +- include/reloc.h | 39 + nand_spl/board/freescale/mpc8536ds/nand_boot.c|1 + nand_spl/board/freescale/mpc8569mds/nand_boot.c |1 + nand_spl/board/freescale/mpc8572ds/nand_boot.c|1 + nand_spl/board/freescale/p1010rdb/nand_boot.c |1 + nand_spl/board/freescale/p1023rds/nand_boot.c |1 + nand_spl/board/freescale/p1_p2_rdb/nand_boot.c|1 + nand_spl/board/freescale/p1_p2_rdb_pc/nand_boot.c |1 + nand_spl/nand_boot_fsl_nfc.c |1 + 23 files changed, 61 insertions(+), 1 deletions(-) create mode 100644 include/reloc.h diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c b/arch/arm/cpu/arm926ejs/davinci/spl.c index f475f9b..53903e5 100644 --- a/arch/arm/cpu/arm926ejs/davinci/spl.c +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c index 9c35a09..06039fe 100644 --- a/arch/arm/cpu/armv7/omap-common/spl.c +++ b/arch/arm/cpu/armv7/omap-common/spl.c @@ -35,6 +35,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index 3d78274..bf1bf79 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c index 63fe297..a7eaf76 100644 --- a/arch/avr32/lib/board.c +++ b/arch/avr32/lib/board.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c index 259b71c..85495cc 100644 --- a/arch/m68k/lib/board.c +++ b/arch/m68k/lib/board.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c index d998f0e..e5bdcfc 100644 --- a/arch/mips/lib/board.c +++ b/arch/mips/lib/board.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c index 66e4537..9295f46 100644 --- a/arch/nds32/lib/board.c +++ b/arch/nds32/lib/board.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c index ff5888e..248d452 100644 --- a/arch/powerpc/lib/board.c +++ b/arch/powerpc/lib/board.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #ifdef CONFIG_8xx #include diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c index d742fec..3d00f20 100644 --- a/arch/x86/lib/board.c +++ b/arch/x86/lib/board.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/board/freescale/mpc8313erdb/mpc8313erdb.c b/board/freescale/mpc8313erdb/mpc8313erdb.c index 730ec4e..ef98ba6 100644 --- a/board/freescale/mpc8313erdb/mpc8313erdb.c +++ b/board/freescale/mpc8313erdb/mpc8313erdb.c @@ -27,6 +27,7 @@ #include #endif #include +#include #include #include #include diff --git a/board/freescale/mpc8315erdb/mpc8315erdb.c b/board/freescale/mpc8315erdb/mpc8315erdb.c index 5dc558a..848847b 100644 --- a/board/freescale/mpc8315erdb/mpc8315erdb.c +++ b/board/freescale/mpc8315erdb/mpc8315erdb.c @@ -34,6 +34,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/samsung/smdk6400/smdk6400_nand_spl.c b/board/samsung/smdk6400/smdk6400_nand_spl.c index a023284..23bbad3 100644 --- a/board/samsung/smdk6400/smdk6400_nand_spl.c +++ b/board/samsung/smdk6400/smdk6400_nand_spl.c @@ -29,6 +29,7 @@ */ #include +#include void board_init_f(unsigned long bootflag) { diff --git a/board/sheldon/simpc8313/simpc8313.c b/board/sheldon/simpc8313/simpc8313.c index 9126c42..09d754b 1006
[U-Boot] [RESEND PATCH v3 3/6] Add generic relocation feature
Add a relocation implementation as the first thing in the generic board library. This library is needed by SPL also. We create a separate header file for link symbols defined by the link scripts. It is helpful to have these all in one place and try to make them common across architectures. Since Linux already has a similar file, we bring this in even though many of the symbols there are not relevant to us. The __relocate_code() function is what we expect all architectures which support relocation will use eventually. For now, they all override this with their own version. Signed-off-by: Simon Glass --- Changes in v2: - Add README file for relocation - Add function comments - Import asm-generic/sections.h from Linux and add U-Boot extras - Move reloc.c into common/ - Squash generic link symbols patch into generic relocation patch - Use memset, memcpy instead of inline code common/Makefile|4 + common/reloc.c | 121 doc/README.relocation | 87 include/asm-generic/sections.h | 92 ++ include/reloc.h| 15 + 5 files changed, 319 insertions(+), 0 deletions(-) create mode 100644 common/reloc.c create mode 100644 doc/README.relocation create mode 100644 include/asm-generic/sections.h diff --git a/common/Makefile b/common/Makefile index 2d9ae8c..3801c28 100644 --- a/common/Makefile +++ b/common/Makefile @@ -189,6 +189,10 @@ COBJS-y += dlmalloc.o COBJS-y += memsize.o COBJS-y += stdio.o +ifndef CONFIG_SYS_SKIP_RELOC +COBJS-y += reloc.o +endif + COBJS := $(sort $(COBJS-y)) XCOBJS := $(sort $(XCOBJS-y)) diff --git a/common/reloc.c b/common/reloc.c new file mode 100644 index 000..2344e98 --- /dev/null +++ b/common/reloc.c @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +static int reloc_make_copy(void) +{ + char *dst_addr = (char *)gd->relocaddr; + + /* TODO: __text_start would be better when we have it */ + char *src_addr = (char *)_start; + /* TODO: switch over to __image_copy_end when we can */ +#ifdef CONFIG_SPL_BUILD + char *end_addr = src_addr + _image_copy_end_ofs; +#else + char *end_addr = src_addr + _rel_dyn_start_ofs; +#endif + + if (dst_addr != src_addr) { + size_t size = end_addr - src_addr; + + debug("%s: copy code %p-%p to %p-%p\n", __func__, + src_addr, end_addr, dst_addr, dst_addr + size); + memcpy(dst_addr, src_addr, size); + } + return 0; +} + +static int reloc_elf(void) +{ +#ifndef CONFIG_SPL_BUILD + const Elf32_Rel *ptr, *end; + Elf32_Addr *addr; + char *src_addr = (char *)_start; + Elf32_Sym *dynsym; + ulong reloc_ofs = gd->reloc_off; + + /* scan the relocation table for relevant entries */ + ptr = (Elf32_Rel *)(src_addr + _rel_dyn_start_ofs); + end = (Elf32_Rel *)(src_addr + _rel_dyn_end_ofs); + dynsym = (Elf32_Sym *)(src_addr + _dynsym_start_ofs); + debug("%s: process reloc entries %p-%p, dynsym at %p\n", __func__, + ptr, end, dynsym); + for (; ptr < end; ptr++) { + addr = (Elf32_Addr *)(ptr->r_offset + reloc_ofs); + if (arch_elf_relocate_entry(addr, ptr->r_info, dynsym, + reloc_ofs)) + return -1; + } +#endif + return 0; +} + +static int reloc_clear_bss(void) +{ + char *dst_addr = (char *)_start + _bss_start_ofs; + size_t size = _bss_end_ofs - _bss_start_ofs; + +#ifndef CONFIG_SPL_BUILD + /* No relocation for SPL (TBD: better to set reloc_off to zero) */ + dst_addr += gd->reloc_off; +#endif + + /* TODO: use memset */ + debug("%s: zero bss %p-%p\n", __func__, dst_addr, dst_addr + size); + memset(dst_addr, '\0', size); + + return 0; +} + +void __relocate_code(ulong dest_addr_sp, gd_t *new_gd, ulong dest_addr) +{ + ulong new_board_init_r = (uintptr_t)board_init_r + gd-
[U-Boot] [RESEND PATCH v3 2/6] define CONFIG_SYS_SKIP_RELOC for all archs
We are introducing a new generic relocation features and we want this to be the default. So we need to opt all architectures out first. Some may never have relocation, but those that do will eventually move over to this generic relocation framework. This is part of the unified board effort, but since we are only dealing with relocation in this series, CONFIG_SYS_SKIP_RELOC is more appropriate than CONFIG_SYS_LEGACY_BOARD. Signed-off-by: Simon Glass --- Changes in v2: - Use CONFIG_SYS_SKIP_RELOC instead of CONFIG_SYS_LEGACY_BOARD README|4 arch/arm/config.mk|3 +++ arch/avr32/config.mk |3 +++ arch/blackfin/config.mk |3 +++ arch/m68k/config.mk |3 +++ arch/microblaze/config.mk |3 +++ arch/mips/config.mk |3 +++ arch/nds32/config.mk |3 +++ arch/nios2/config.mk |3 +++ arch/powerpc/config.mk|3 +++ arch/sandbox/config.mk|3 +++ arch/sh/config.mk |3 +++ arch/sparc/config.mk |3 +++ arch/x86/config.mk|3 +++ 14 files changed, 43 insertions(+), 0 deletions(-) diff --git a/README b/README index 9d713e8..43fc5ec 100644 --- a/README +++ b/README @@ -2744,6 +2744,10 @@ Configuration Settings: cases. This setting can be used to tune behaviour; see lib/hashtable.c for details. +- CONFIG_SYS_SKIP_RELOC + This makes U-Boot skip relocation for those architectures which + don't support it. It is normally defined in arch/xxx/config.mk + The following definitions that deal with the placement and management of environment data (variable area); in general, we support the following configurations: diff --git a/arch/arm/config.mk b/arch/arm/config.mk index 45f9dca..f47d4f7 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -81,3 +81,6 @@ endif ifndef CONFIG_NAND_SPL LDFLAGS_u-boot += -pie endif + +# We use legacy relocation for now +CONFIG_SYS_SKIP_RELOC := y diff --git a/arch/avr32/config.mk b/arch/avr32/config.mk index d8e7ebb..1995983 100644 --- a/arch/avr32/config.mk +++ b/arch/avr32/config.mk @@ -31,3 +31,6 @@ PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections LDFLAGS_u-boot = --gc-sections --relax LDSCRIPT = $(SRCTREE)/$(CPUDIR)/u-boot.lds + +# We use legacy relocation for now +CONFIG_SYS_SKIP_RELOC := y diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk index 3595aa2..56047c8 100644 --- a/arch/blackfin/config.mk +++ b/arch/blackfin/config.mk @@ -37,6 +37,9 @@ CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE))) PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN +# Blackfin does not do relocation +CONFIG_SYS_SKIP_RELOC := y + LDFLAGS_FINAL += --gc-sections LDFLAGS += -m elf32bfin PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections diff --git a/arch/m68k/config.mk b/arch/m68k/config.mk index 11ba334..52bfc81 100644 --- a/arch/m68k/config.mk +++ b/arch/m68k/config.mk @@ -29,3 +29,6 @@ PLATFORM_CPPFLAGS += -DCONFIG_M68K -D__M68K__ PLATFORM_LDFLAGS += -n PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections LDFLAGS_FINAL += --gc-sections + +# We use legacy relocation for now +CONFIG_SYS_SKIP_RELOC := y diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk index abea70b..7645f2e 100644 --- a/arch/microblaze/config.mk +++ b/arch/microblaze/config.mk @@ -29,3 +29,6 @@ CROSS_COMPILE ?= mb- CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F0 PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__ + +# Microblaze does not do relocation +CONFIG_SYS_SKIP_RELOC := y diff --git a/arch/mips/config.mk b/arch/mips/config.mk index 6ab8acd..832b93f 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -52,3 +52,6 @@ PLATFORM_CPPFLAGS += -msoft-float PLATFORM_LDFLAGS += -G 0 -static -n -nostdlib PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections LDFLAGS_FINAL += --gc-sections + +# We use legacy relocation for now +CONFIG_SYS_SKIP_RELOC := y diff --git a/arch/nds32/config.mk b/arch/nds32/config.mk index c589829..4a4499b 100644 --- a/arch/nds32/config.mk +++ b/arch/nds32/config.mk @@ -33,3 +33,6 @@ PLATFORM_RELFLAGS += -gdwarf-2 PLATFORM_CPPFLAGS += -DCONFIG_NDS32 -D__nds32__ -G0 -ffixed-10 -fpie LDFLAGS_u-boot = --gc-sections --relax + +# We use legacy relocation for now +CONFIG_SYS_SKIP_RELOC := y diff --git a/arch/nios2/config.mk b/arch/nios2/config.mk index 7b03ed8..cde7f82 100644 --- a/arch/nios2/config.mk +++ b/arch/nios2/config.mk @@ -31,3 +31,6 @@ PLATFORM_CPPFLAGS += -G0 LDFLAGS_FINAL += --gc-sections PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections + +# NIOS2 does not do relocation +CONFIG_SYS_SKIP_RELOC := y diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk index a307154..eba562f 100644 --- a/arch/powerpc/config.mk +++ b/arch/powerpc/config.mk @@
[U-Boot] [RESEND PATCH v3 4/6] arm: Add processor function library
Add a library to hold ARM assembler code which is generic across all ARM CPUs. At first it just holds some basic relocation code. The plan is to move more start.S code here. Signed-off-by: Simon Glass --- Changes in v2: - Invalidate I-cache when we jump to relocated code arch/arm/lib/Makefile |2 ++ arch/arm/lib/proc.S | 40 2 files changed, 42 insertions(+), 0 deletions(-) create mode 100644 arch/arm/lib/proc.S diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 300c8fa..213c76f 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -48,6 +48,8 @@ SOBJS-$(CONFIG_USE_ARCH_MEMSET) += memset.o SOBJS-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o endif +SOBJS-y += proc.o + SRCS := $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \ $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y)) diff --git a/arch/arm/lib/proc.S b/arch/arm/lib/proc.S new file mode 100644 index 000..dba7c11 --- /dev/null +++ b/arch/arm/lib/proc.S @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + + +/** + * Jump to board_init_r with a new stack pointer + * + * @param gd Pointer to global data + * @param dest_addrDestination address from global data + * @param func Address of board_init_r function (relocated) + * @param sp New stack pointer + */ +.globl proc_call_board_init_r +proc_call_board_init_r: +#ifndef CONFIG_SYS_ICACHE_OFF + mcr p15, 0, r0, c7, c5, 0 @ invalidate icache + mcr p15, 0, r0, c7, c10, 4 @ DSB + mcr p15, 0, r0, c7, c5, 4 @ ISB +#endif + mov sp, r3 + /* jump to it ... */ + mov pc, r2 -- 1.7.7.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RESEND PATCH v3 0/6] Introduce generic relocation feature
(I have updated this cover letter slightly and rebased to master. This series has trivial conflicts with the generic board series in the arch/xxx/config.mk additions and also in that they both add include/linux/sections.h. I original had this series first in my list, but the generic board series now also applies directly to master, so I will leave this one as is until I know what ordering is required). This is the second patch series aiming to unify the various board.c files in each architecture into a single one. This series implements a generic relocation feature, which is the bridge between board_init_f() and board_init_r(). It then moves ARM over to use this framework, as an example. On ARM the relocation code is duplicated for each CPU yet it is the same. We can bring this up to the arch level. But since (I believe) Elf relocation is basically the same process for all archs, there is no reason not to bring it up to the generic level. Each architecture which uses this framework needs to provide a function called arch_elf_relocate_entry() which processes a single relocation entry. This is a static inline function to reduce code size overhead. For ARM, a new arch/arm/lib/proc.S file is created, which holds generic ARM assembler code (things that cannot be written in C and are common functions used by all ARM CPUs). This helps reduce duplication. Interrupt handling code and perhaps even some startup code can move there later. It may be useful for other architectures with a lot of different CPUs to have a similar file. Code size on my ARMv7 system increases by 54 bytes with generic relocation. This overhead is mostly just literal pool access and setting up to call the relocated U-Boot at the end. On my system, execution time increases from 10.8ms to 15.6ms due to the less efficient C implementations of the copy and zero loops. If execution time is of concern, you can define CONFIG_USE_ARCH_MEMSET and CONFIG_USE_ARCH_MEMCPY to reduce it. For met this reduces relocation time to 5.4ms, i.e. twice as fast as the old system. One problem remains which causes tx25 to fail to build. It doesn't have string.c in its SPL code and the architecture-specific versions of memset()/memcpy() are too large. I propose to add a local change to reloc.c that uses inline code for boards that use the old legacy SPL framework. We can remove it later. This is not included in v4 but I am interested in comments on this approach. An alternative would be just to add simple memset()/memcpy() functions just for this board. Changes in v2: - Add README file for relocation - Add function comments - Import asm-generic/sections.h from Linux and add U-Boot extras - Invalidate I-cache when we jump to relocated code - Make relocation symbols global so we can use them outside start.S - Move reloc.c into common/ - Squash generic link symbols patch into generic relocation patch - Use CONFIG_SYS_SKIP_RELOC instead of CONFIG_SYS_LEGACY_BOARD - Use an inline relocation function to reduce code size - Use memset, memcpy instead of inline code Changes in v3: - Rebase to master - Remove the 'reloc' tag from each commit Simon Glass (6): Create reloc.h and include it where needed define CONFIG_SYS_SKIP_RELOC for all archs Add generic relocation feature arm: Add processor function library arm: Move over to generic relocation arm: Remove unused code in start.S README|4 + arch/arm/cpu/arm1136/start.S | 133 ++ arch/arm/cpu/arm1176/start.S | 214 ++--- arch/arm/cpu/arm720t/start.S | 127 ++--- arch/arm/cpu/arm920t/start.S | 135 ++ arch/arm/cpu/arm925t/start.S | 135 ++ arch/arm/cpu/arm926ejs/davinci/spl.c |1 + arch/arm/cpu/arm926ejs/start.S| 144 ++- arch/arm/cpu/arm946es/start.S | 130 ++--- arch/arm/cpu/arm_intcm/start.S| 135 ++ arch/arm/cpu/armv7/omap-common/spl.c |1 + arch/arm/cpu/armv7/start.S| 140 ++ arch/arm/cpu/ixp/start.S | 127 ++--- arch/arm/cpu/lh7a40x/start.S | 124 ++--- arch/arm/cpu/pxa/start.S | 138 ++ arch/arm/cpu/s3c44b0/start.S | 127 ++--- arch/arm/cpu/sa1100/start.S | 124 ++--- arch/arm/include/asm/reloc.h | 56 ++ arch/arm/lib/Makefile |2 + arch/arm/lib/board.c |1 + arch/arm/lib/proc.S | 40 arch/avr32/config.mk |3 + arch/avr32/lib/board.c|1 + arch/blackfin/config.mk
Re: [U-Boot] [PATCH 2/2] nand/fsl_elbc: Convert to self-init
On 01/16/2012 01:58 PM, Mike Frysinger wrote: > On Monday 16 January 2012 11:51:14 Scott Wood wrote: >> On 01/15/2012 01:29 PM, Mike Frysinger wrote: >>> On Thursday 12 January 2012 20:59:41 Scott Wood wrote: --- a/drivers/mtd/nand/fsl_elbc_nand.c +++ b/drivers/mtd/nand/fsl_elbc_nand.c +#ifndef CONFIG_SYS_NAND_BASE_LIST +#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE } +#endif >>> >>> would this be better off in nand.h ? >> >> I'm trying to get away from the model where the NAND subsystem pretends >> to know anything about how a driver talks to its hardware (except when >> the driver chooses to use a common NAND function that uses things like >> IO_ADDR_R/W). For eLBC it probably makes more sense to specify the >> chipselect rather than the address (we have to search for the former >> based on the latter), though that's a separate change that can happen on >> its own now that the connection to subsystem code has been severed. > > so the idea would be to let CONFIG_SYS_NAND_BASE_LIST and > CONFIG_SYS_NAND_BASE > die for devices that could care less ? Yes. > and eventually obsolete CONFIG_SYS_MAX_NAND_DEVICE ? This is harder, as we still have a notion of an array of enumerated NAND devices in the command line code. -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] nand/fsl_elbc: Convert to self-init
On Monday 16 January 2012 11:51:14 Scott Wood wrote: > On 01/15/2012 01:29 PM, Mike Frysinger wrote: > > On Thursday 12 January 2012 20:59:41 Scott Wood wrote: > >> --- a/drivers/mtd/nand/fsl_elbc_nand.c > >> +++ b/drivers/mtd/nand/fsl_elbc_nand.c > >> > >> +#ifndef CONFIG_SYS_NAND_BASE_LIST > >> +#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE } > >> +#endif > > > > would this be better off in nand.h ? > > I'm trying to get away from the model where the NAND subsystem pretends > to know anything about how a driver talks to its hardware (except when > the driver chooses to use a common NAND function that uses things like > IO_ADDR_R/W). For eLBC it probably makes more sense to specify the > chipselect rather than the address (we have to search for the former > based on the latter), though that's a separate change that can happen on > its own now that the connection to subsystem code has been severed. so the idea would be to let CONFIG_SYS_NAND_BASE_LIST and CONFIG_SYS_NAND_BASE die for devices that could care less ? and eventually obsolete CONFIG_SYS_MAX_NAND_DEVICE ? -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [GIT PULL] please pull u-boot-mpc85xx
wrote: > The reason I ask is that you're missing some of my patches. > > http://patchwork.ozlabs.org/project/uboot/list/?submitter=timur Ok, technically you're only missing ONE of my patches. http://patchwork.ozlabs.org/patch/118367/ -- Timur Tabi Linux kernel developer at Freescale ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [GIT PULL] please pull u-boot-mpc85xx
On Thu, Jan 12, 2012 at 5:49 PM, Tabi Timur-B04825 wrote: > Are you going to make another pull request before the window closes? The reason I ask is that you're missing some of my patches. http://patchwork.ozlabs.org/project/uboot/list/?submitter=timur -- Timur Tabi Linux kernel developer at Freescale ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2 V2] arm926: Flush the data cache before disabling it.
On Fri, Jan 13, 2012 at 10:38 AM, Sughosh Ganu wrote: > hi Heiko, > > On Fri Jan 13, 2012 at 04:29:29PM +0100, Heiko Schocher wrote: >> Hello Sugosh, >> >> Sughosh Ganu wrote: >> > hi Christian, >> > >> > On Fri Jan 13, 2012 at 09:06:26AM +0100, Christian Riesch wrote: >> >> Hi Sughosh, >> >> I had a look at the patch and I tried to understand what's going on >> >> here (I must confess that I didn't know anything about this cache >> >> stuff). >> > >> > Ok, thanks for taking time off to understand this issue. >> > >> >> On Tue, Jan 10, 2012 at 7:12 PM, Sughosh Ganu >> >> wrote: >> >>> The current implementation invalidates the cache instead of flushing >> >>> it. This causes problems on platforms where the spl/u-boot is already >> >>> loaded to the RAM, with caches enabled by a first stage bootloader. >> >> Hmm.. how did u-boot work on such boards? How can u-boot work with D-Cache >> enabled, if u-boot is not initializing it? (And I think, on davinci SoC >> we have a none working uboot ethernet driver if d-cache is enabled too). >> There must be a page_table in DRAM for using D-Cache in U-Boot, if u-boot >> don't initialize it, it maybe overrides it ... or miss I something? > > Well, there is some data in the cache, which if not flushed creates > problems on my board. I get the board to boot just by commenting out > cpu_init_crit call. My hypothesis that the D-cache is enabled is > simply because cache invalidation followed by cache disabling breaks > the board, while flushing it prior to disabling gets it to boot > fine. This(invalidation) would not have been a problem if the cache > was in the disabled state. Putting my TI hat on, I've confirmed with the RBL folks that they aren't turning on ICACHE/DCACHE. -- Tom ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] arm, davinci: add PLL0 prediv to da850 lowlevel setup
The OMAP-L138 has a pre-divider available on PLL0. Add support to da850_lowlevel.c for configuring PLL0's pre-divider. This is to achieve certain OPP's -- e.g. the 372MHz OPP used also by Linux. Signed-off-by: Ben Gardiner Cc: Christian Riesch CC: Heiko Schocher Cc: Sandeep Paulraj Cc: Tom Rini Cc: Albert ARIBAUD --- arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c |7 +++ arch/arm/include/asm/arch-davinci/pll_defs.h|3 ++- 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c index a532f8a..eec06bc 100644 --- a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c +++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c @@ -85,6 +85,13 @@ int da850_pll_init(struct davinci_pllc_regs *reg, unsigned long pllmult) /* Enable the PLL from Disable Mode PLLDIS bit to 0 */ clrbits_le32(®->pllctl, PLLCTL_PLLDIS); +#if defined(CONFIG_SYS_DA850_PLL0_PREDIV) + /* program the prediv */ + if (reg == davinci_pllc0_regs && CONFIG_SYS_DA850_PLL0_PREDIV) + writel((PLL_DIVEN | CONFIG_SYS_DA850_PLL0_PREDIV), + ®->prediv); +#endif + /* Program the required multiplier value in PLLM */ writel(pllmult, ®->pllm); diff --git a/arch/arm/include/asm/arch-davinci/pll_defs.h b/arch/arm/include/asm/arch-davinci/pll_defs.h index f1396e3..1c8d83f 100644 --- a/arch/arm/include/asm/arch-davinci/pll_defs.h +++ b/arch/arm/include/asm/arch-davinci/pll_defs.h @@ -68,7 +68,8 @@ struct dv_pll_regs { #define PLLCTL_RES_9 (1 << 8) #define PLLCTL_EXTCLKSRC (1 << 9) -#define PLL_POSTDEN(1 << 15) +#define PLL_DIVEN (1 << 15) +#define PLL_POSTDENPLL_DIVEN #define PLL_SCSCFG3_DIV45PENA (1 << 2) #define PLL_SCSCFG3_EMA_CLKSRC (1 << 1) -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/5] net: ll_temac: Add LL TEMAC driver to u-boot
Am Montag, den 16.01.2012, 09:14 +0100 schrieb Wolfgang Denk: > Dear Stephan Linz, Hi Wolfgang, you are right in all points. I'll go into the next round and handle all new request. br, Stephan > > In message <1326652166.18981.213.camel@keto> you wrote: > > > > > come code already declares PktBuf ... can't you use that ? > > > > Hm, what do you mean exactly here? > > > > These are the two DMA transfer buffers. I have no idea if there are > > buffers in the upper layer (NET) and how I can use it for DMA transfers. > > It's a bad thing not to look at common code, but thnings like that > happen too easily. > > However, now that this has been pointed out, you cannot simply ignore > such a request. > > > Therfore I create my own rx/tx buffers and copy data. That reduce the > > performance a little bit, but it's OK. Furthermore I have to use DMA > > safe buffers here (no cache, 32 byte alignment). > > I could imagine this to be a pretty common requirement. > > > > this looks like a struct that should get allocated on the fly based on > > > arguments given to the driver's registration func > > > > OK, it wast a little bit RAM. We can optimize the code later. I want to > > see more testing results on differnet Microblaze and PPC platforms. > > we can fix this now, right? > > > > the memory is already zero-ed by the call to calloc, so this for loop is > > > useless (and if it wasn't, you'd still use memset()) > > > > Sure, we can remove this part in one of the next code optimization. > > No. Please fix this now, and then add a cleaned up driver. This is > what the peer review process is all about. > > Best regards, > > Wolfgang Denk > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm, davinci: cam_enc_4xx board updates
On Sun, Jan 15, 2012 at 12:59 AM, Heiko Schocher wrote: [snip] > diff --git a/board/ait/cam_enc_4xx/ublimage.cfg > b/board/ait/cam_enc_4xx/ublimage.cfg > index 95182ca..2374c72 100644 > --- a/board/ait/cam_enc_4xx/ublimage.cfg > +++ b/board/ait/cam_enc_4xx/ublimage.cfg > @@ -39,7 +39,7 @@ PAGES 6 > > # Block number where user bootloader is present > # RBL starts always with block 1 > -START_BLOCK 5 > +START_BLOCK 0 Is the comment here still correct and fully explaining things? It's a little puzzling when I read it, but I don't have a good handle on the UBL stuff yet. And aside from expecting a rework of some of this to match Wolfgang's comments about FIT images, the rest seems fine to me. -- Tom ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] SPI: Add i.MX ECSPI driver
On 16/01/2012 18:29, Eric Nelson wrote: >> > Good catch guys. > > The mxc_spi driver already has support for the ECSPI on i.MX6, > and just needs a small amount of glue to function. Right - and we already discussed in the past how to avoid to put specific SOC code inside the driver. In fact, the cspi_regs structure was already moved into the specific SOC header (imx-regs.h) - but the definitions of the single bits of the registers are still inside the driver, as well as the base address of the (e)cspi controllers. They should also be moved - take into acoount by implementing your changes for i.mx6. Best regards, Stefano Babic -- = DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: off...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] SPI: Add i.MX ECSPI driver
On 01/13/2012 04:45 AM, Dirk Behme wrote: On 13.01.2012 11:48, Stefano Babic wrote: On 12/01/2012 16:27, Dirk Behme wrote: From: Eric Nelson Signed-off-by: Eric Nelson CC: Jason Liu CC: Stefano Babic --- I see no specific i.MX6 code here, and the function is not very different as spi_xchg_single(). Really I do not think we can add a copy of the already provided driver, sorry. Yes, understood, see http://lists.denx.de/pipermail/u-boot/2012-January/115611.html Let's have Eric a look to this. Good catch guys. The mxc_spi driver already has support for the ECSPI on i.MX6, and just needs a small amount of glue to function. FWIW, it should also be easy to add support for i.MX53. Regards, Eric ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] net: ll_temac: Remove useless memory erasing
Am Sonntag, den 15.01.2012, 18:44 -0500 schrieb Mike Frysinger: > On Sunday 15 January 2012 14:46:07 Stephan Linz wrote: > > In xilinx_ll_temac_initialize() the memory is already zero-ed > > by the call to calloc, so this loop is useless. > > has this driver already been merged ? if not, the process is to update the > patch and send the new version to the list as a v2 ... > -mike You are right, I will post a new V9 patch ... -- Best regards, Stephan Linz __ MB-Ref: http://www.li-pro.de/xilinx_mb:mbref:start OpenDCC: http://www.li-pro.net/opendcc.phtml PC/M: http://www.li-pro.net/pcm.phtml Sourceforge: http://sourceforge.net/users/slz Gitorious: https://gitorious.org/~slz ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] nand/fsl_elbc: Convert to self-init
On 01/16/2012 10:51 AM, Scott Wood wrote: > On 01/15/2012 01:29 PM, Mike Frysinger wrote: >> On Thursday 12 January 2012 20:59:41 Scott Wood wrote: >>> --- a/drivers/mtd/nand/fsl_elbc_nand.c >>> +++ b/drivers/mtd/nand/fsl_elbc_nand.c >>> >>> +#ifndef CONFIG_SYS_NAND_BASE_LIST >>> +#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE } >>> +#endif >> >> would this be better off in nand.h ? > > I'm trying to get away from the model where the NAND subsystem pretends > to know anything about how a driver talks to its hardware (except when > the driver chooses to use a common NAND function that uses things like > IO_ADDR_R/W). For eLBC it probably makes more sense to specify the > chipselect rather than the address (we have to search for the former > based on the latter), though that's a separate change that can happen on > its own now that the connection to subsystem code has been severed. Also, even when there isn't a mismatch with the hardware interface, this frees up the driver to initialize in other ways, separate from a fixed list iterated over during U-Boot startup -- the addresses could come from a device tree, for example. -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] nand/fsl_elbc: Convert to self-init
On 01/15/2012 01:29 PM, Mike Frysinger wrote: > On Thursday 12 January 2012 20:59:41 Scott Wood wrote: >> --- a/drivers/mtd/nand/fsl_elbc_nand.c >> +++ b/drivers/mtd/nand/fsl_elbc_nand.c >> >> +#ifndef CONFIG_SYS_NAND_BASE_LIST >> +#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE } >> +#endif > > would this be better off in nand.h ? I'm trying to get away from the model where the NAND subsystem pretends to know anything about how a driver talks to its hardware (except when the driver chooses to use a common NAND function that uses things like IO_ADDR_R/W). For eLBC it probably makes more sense to specify the chipselect rather than the address (we have to search for the former based on the latter), though that's a separate change that can happen on its own now that the connection to subsystem code has been severed. -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] OMAP3 performance regression in 2011.12
On Monday, January 16, 2012 05:34:12 PM Philip Balister wrote: > > I built u-boot with this change reverted and compared the amount of time > it took to build sip from source. > > Reverting the change improved compile time by about a factor of four, so > it looks like the kernel does not properly re-enable the L2 cache. > > See: > > http://comments.gmane.org/gmane.linux.ports.arm.omap/69560 > > For discussion on the linux-omap list. > > Philip > FYI: included in meta-gumstix today Andreas ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] OMAP3 performance regression in 2011.12
On 01/16/2012 04:03 AM, Joe Woodward wrote: > -Original Message- > From: Philip Balister > To: Joe Woodward > Date: Fri, 13 Jan 2012 15:53:37 -0500 > Subject: Re: OMAP3 performance regression in 2011.12 > >> Did you find out anymore info on this? I may have a customer who is >> seeing this on a 3.o based overo. >> > > (CC'ing in the mailing list again). > > Sadly not, no more replies to this. > > I think either this change needs reverting (but that'll break OMAP4) or at > least encasing in #ifdefs so that it isn't applied for OMAP3. > > I was going to ask on the Linux OMAP mailing list if the L2/outer cache is > enabled on OMAP3 in Linux but haven't got round to it yet! > > Cheers, > Joe > >> Philip >> >> On 01/09/2012 10:48 AM, Joe Woodward wrote: -Original Message- From: Tom Rini To: Joe Woodward Cc: u-boot@lists.denx.de Date: Mon, 9 Jan 2012 08:11:07 -0700 Subject: Re: [U-Boot] OMAP3 performance regression in 2011.12 > On Mon, Jan 9, 2012 at 3:27 AM, Joe Woodward wrote: >> Commit "armv7: disable L2 cache in cleanup_before_linux()" on 6th Dec > 2011 by Aneesh V adds the following: >> >> arch/arm/cpu/armv7/cpu.c:cleanup_before_linux() >> >> ... >> v7_out_cache_disable(); I built u-boot with this change reverted and compared the amount of time it took to build sip from source. Reverting the change improved compile time by about a factor of four, so it looks like the kernel does not properly re-enable the L2 cache. See: http://comments.gmane.org/gmane.linux.ports.arm.omap/69560 For discussion on the linux-omap list. Philip >> ... >> >> The commit message implies this change was to make booting >> reliable > on OMAP4 by disabling L2 cache before jumping to Linux. >> >> However, when running with a stock 3.2 Linux kernel on an OMAP3 it > has the effect of massively reducing system performance (when >> running > using an OMAP3- >> only 3.2 Linux Kernel on a GUSMTIX Overo OMAP3530). >> >> Therefore, I assume this means that the kernel isn't turning the >> L2 > cache back on for an OMAP3 (at least with my kernel build)! >> >> So, my question is... >> >> Are there any Kconfig options in Linux that will re-enable the L2 > cache (something obvious that I've missed), or is this commit just > bad-news for OMAP3? > > Are you certain that this is the commit that's causing your >> problem? > The kernel is responsible for turning the cache back on and has for >> a > long time, iirc. > > -- > Tom >>> >>> (apologies for previous top posting, wasn't paying attention to what >> I was doing!) >>> >>> I'm fairly certain... >>> >>> If I take the 2011.12 uBoot release the kernel takes about twice the >> time to boot (compared to 2011.09), and the device is noticably slower. >>> >>> Then if I comment out the v7_out_cache_disable() line in cpu.c and >> rebuild uBoot then everything speeds up again. >>> >>> I thought the kernel would turn on the cache again too... >>> >>> Is there any easy way from userspace to determine if the cache is on? >>> >>> I did a bit of Googling and found: >>> http://www.spinics.net/lists/arm-kernel/msg50064.html >>> http://www.spinics.net/lists/arm-kernel/msg50083.html >>> >>> It may be that the kernel is re-enabling the L1 cache, but expecting >> L2 to be on? >>> Or the way v7_out_cache_disable() disables L2 is not compatible with >> the way the kernel expects to re-enable it? >>> >>> Also, in the Linux there seem to be OMAP4 specific functions for >> re-enabling the L2 cache (omap4-common.c:omap_l2_cache_init()), but >> none for OMAP3. I'm >>> assuming this is because up to now OMAP3 is assumed to have the L2 >> left enabled? Either that, or there is some generic Cortex-A8 method >> for enabling the L2 >>> cache in the kernel soures that I've not found... >>> >>> Cheers, >>> Joe >>> ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot >> ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] net/eth.c: fix eth_write_hwaddr() to use dev->enetaddr as fall back
Dear Philip Balister, In message <4f142f52@balister.org> you wrote: > > > I'm not going to pull that patch. > > > > Please explain which actual problem you're trying to fix. > > For u-boot for an overo based product that uses the SMSC911x ethernet > chip (with MAC address set via EEPROM connected to the SMSC911x chip) I > have a local patch to prevent u-boot from printing: > > Warning: failed to set MAC address Something went wrong here. Either you should not run the operation that failed, or you should find out why it failed and fixe the cause of that. > The MAC address is still OK and we basically removed the code that led > to the message to reduce customer confusion :) Papering over errors or warnings is rarely a good thing. We should understand what happened and fix the original cause of the problem instead. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de I wrote my name at the top of the page. I wrote down the number of the question ``1''. After much reflection I put a bracket round it thus ``(1)''. But thereafter I could not think of anything connected with it that was either relevant or true. - Sir Winston Churchill _My Early Life_ ch. 2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] SPI Test
> On 16.01.2012 12:23, Marek Vasut wrote: > >> Hmm, > >> > >> can you tell me what type of SPI flash you have installed? > >> Typically the read-status-register operation requires a low to high > >> transition to get terminated. This is from my flash' datasheet: > >> > >> Read-Status-Register (RDSR) > >> The Read-Status-Register (RDSR) instruction allows reading of the status > >> register. The status register > >> may be read at any time even during a Write (Program/Erase) operation. > >> When a Write operation is in > >> progress, the Busy bit may be checked before sending any new commands to > >> assure that the new > >> commands are properly received by the device. CE# must be driven low > >> before the RDSR instruction is > >> entered and remain low until the status data is read. > >> Read-Status-Register is continuous with ongoing > >> clock cycles until it is terminated by a low to high transition of the > >> CE#. See Figure 16 for the RDSR instruction sequence... > >> It's a SST part. > > > > I just noticed ... Matthias, why don't you CC the mailing list? > > Fabio wanted to stop the list being flood with this discussion. No, please flood ... that's what the mailing list is for in there. > But you are right. Let's stop this thread an return to the list. We can safely continue here. > > Matthias > > > Also, I can't really remember now what part there is. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] imximage: Add MX53 to the documentation
On 16/01/2012 15:05, Dirk Behme wrote: >>> >>> This document describes how to set up a U-Boot image >>> -that can be booted by Freescale MX25, MX35 and MX51 >>> +that can be booted by Freescale MX25, MX35, MX51 and MX53 >>> processors via internal boot mode. >>> >>> These processors can boot directly from NAND, SPI flash and SD card >>> flash >> >> This change is too trivial. I wonder whether it can be squashed with >> pach 2/3? > > Sure, it could. But from logical point of view I've done two patches to > separate > > 1/3: Correct existing stuff > 2/3: Add new stuff (mx6) Well, another way to see (as I can understand Jason's point of view) was to set them as: 1/2 Update documentation 2/2 Add new feature (mx6) By the way, even if I agree that the first patch could be squashed together with the second one, there is no open issues and the substance is not changed at all ;-) I will merge the current three patches into u-boot-imx. Best regards, Stefano Babic -- = DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: off...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] net/eth.c: fix eth_write_hwaddr() to use dev->enetaddr as fall back
On 01/13/2012 02:19 PM, Wolfgang Denk wrote: > Dear Eric Miao, > > In message <1313559224-4627-1-git-send-email-eric.m...@linaro.org> you wrote: >> Ignore the return value of eth_getenv_enetaddr_by_index(), and if it >> fails, fall back to use dev->enetaddr, which could be filled up by >> the ethernet device driver. >> >> Actually, this is the original behavior, and was later changed by >> commit 48506a2cde2458fa1f8c5993afc98e5a4617e1d3. > > I'm not going to pull that patch. > > Please explain which actual problem you're trying to fix. > For u-boot for an overo based product that uses the SMSC911x ethernet chip (with MAC address set via EEPROM connected to the SMSC911x chip) I have a local patch to prevent u-boot from printing: Warning: failed to set MAC address The MAC address is still OK and we basically removed the code that led to the message to reduce customer confusion :) Hopefully, the patch people are talking about here is a proper fix to this problem. Philip > Also, fix the commit ID - the one you list above does not exist in > mainline. > > Best regards, > > Wolfgang Denk > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] imximage: Add MX53 to the documentation
On 16.01.2012 14:58, Jason Hui wrote: On Thu, Jan 12, 2012 at 5:28 PM, Dirk Behme wrote: i.MX53 is supported, too. Add this to the introduction of the documentation. Signed-off-by: Dirk Behme CC: Fabio Estevam CC: Stefano Babic CC: Jason Liu --- doc/README.imximage |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/doc/README.imximage b/doc/README.imximage index c74239d..c3704a4 100644 --- a/doc/README.imximage +++ b/doc/README.imximage @@ -3,7 +3,7 @@ Imximage Boot Image generation using mkimage - This document describes how to set up a U-Boot image -that can be booted by Freescale MX25, MX35 and MX51 +that can be booted by Freescale MX25, MX35, MX51 and MX53 processors via internal boot mode. These processors can boot directly from NAND, SPI flash and SD card flash This change is too trivial. I wonder whether it can be squashed with pach 2/3? Sure, it could. But from logical point of view I've done two patches to separate 1/3: Correct existing stuff 2/3: Add new stuff (mx6) Best regards Dirk ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] imximage: Add MX53 to the documentation
On Thu, Jan 12, 2012 at 5:28 PM, Dirk Behme wrote: > i.MX53 is supported, too. Add this to the introduction of the > documentation. > > Signed-off-by: Dirk Behme > CC: Fabio Estevam > CC: Stefano Babic > CC: Jason Liu > --- > doc/README.imximage | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/doc/README.imximage b/doc/README.imximage > index c74239d..c3704a4 100644 > --- a/doc/README.imximage > +++ b/doc/README.imximage > @@ -3,7 +3,7 @@ Imximage Boot Image generation using mkimage > - > > This document describes how to set up a U-Boot image > -that can be booted by Freescale MX25, MX35 and MX51 > +that can be booted by Freescale MX25, MX35, MX51 and MX53 > processors via internal boot mode. > > These processors can boot directly from NAND, SPI flash and SD card flash This change is too trivial. I wonder whether it can be squashed with pach 2/3? Jason > -- > 1.7.0.4 > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/3] imximage: Sort bootops alphabetically
On Thu, Jan 12, 2012 at 5:28 PM, Dirk Behme wrote: > Signed-off-by: Dirk Behme > CC: Fabio Estevam > CC: Stefano Babic > CC: Jason Liu > --- > Note: This was requested by Wolfgang in > http://www.mail-archive.com/u-boot@lists.denx.de/msg71842.html > > tools/imximage.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/tools/imximage.c b/tools/imximage.c > index f3da139..1e0f5d4 100644 > --- a/tools/imximage.c > +++ b/tools/imximage.c > @@ -47,12 +47,12 @@ static table_entry_t imximage_cmds[] = { > * this is needed to set the correct flash offset > */ > static table_entry_t imximage_bootops[] = { > - {FLASH_OFFSET_SPI, "spi", "SPI Flash", }, > - {FLASH_OFFSET_NAND, "nand", "NAND Flash", }, > - {FLASH_OFFSET_SD, "sd", "SD Card", }, > {FLASH_OFFSET_ONENAND, "onenand", "OneNAND Flash",}, > + {FLASH_OFFSET_NAND, "nand", "NAND Flash", }, > {FLASH_OFFSET_NOR, "nor", "NOR Flash", }, > {FLASH_OFFSET_SATA, "sata", "SATA Disk", }, > + {FLASH_OFFSET_SD, "sd", "SD Card", }, > + {FLASH_OFFSET_SPI, "spi", "SPI Flash", }, > {-1, "", "Invalid", }, > }; Yes, this looks better. Acked-by: Jason Liu > > -- > 1.7.0.4 > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/3] imximage: Add support for i.MX6
On Thu, Jan 12, 2012 at 5:28 PM, Dirk Behme wrote: > The i.MX6 processor can boot from NOR flash and SATA disks, > additionally. Add the flash offsets for these additional > boot modes. > > Signed-off-by: Dirk Behme > Signed-off-by: Fabio Estevam > CC: Stefano Babic > CC: Jason Liu > --- > doc/README.imximage | 13 +++-- > tools/imximage.c | 4 +++- > tools/imximage.h | 2 ++ > 3 files changed, 12 insertions(+), 7 deletions(-) > > diff --git a/doc/README.imximage b/doc/README.imximage > index c3704a4..073e3fc 100644 > --- a/doc/README.imximage > +++ b/doc/README.imximage > @@ -2,12 +2,13 @@ > Imximage Boot Image generation using mkimage > - > > -This document describes how to set up a U-Boot image > -that can be booted by Freescale MX25, MX35, MX51 and MX53 > -processors via internal boot mode. > +This document describes how to set up a U-Boot image that can be booted > +by Freescale MX25, MX35, MX51, MX53 and MX6 processors via internal boot > +mode. > > These processors can boot directly from NAND, SPI flash and SD card flash > -using its internal boot ROM support. They can boot from an internal > +using its internal boot ROM support. MX6 processors additionally support > +boot from NOR flash and SATA disks. All processors can boot from an internal > UART, if booting from device media fails. > Booting from NOR flash does not require to use this image type. > > @@ -59,12 +60,12 @@ Configuration command line syntax: > -- --- > IMXIMAGE_VERSION 1/2 > 1 is for mx25/mx35/mx51 compatible, > - 2 is for mx53 compatible, > + 2 is for mx53/mx6 compatible, > others is invalid and error is generated. > This command need appear the fist before > other valid commands in configuration file. > > - BOOT_FROM nand/spi/sd/onenand > + BOOT_FROM nand/spi/sd/onenand/nor/sata > Example: > BOOT_FROM spi > DATA type address value > diff --git a/tools/imximage.c b/tools/imximage.c > index 8e81bdb..f3da139 100644 > --- a/tools/imximage.c > +++ b/tools/imximage.c > @@ -51,6 +51,8 @@ static table_entry_t imximage_bootops[] = { > {FLASH_OFFSET_NAND, "nand", "NAND Flash", }, > {FLASH_OFFSET_SD, "sd", "SD Card", }, > {FLASH_OFFSET_ONENAND, "onenand", "OneNAND Flash",}, > + {FLASH_OFFSET_NOR, "nor", "NOR Flash", }, > + {FLASH_OFFSET_SATA, "sata", "SATA Disk", }, > {-1, "", "Invalid", }, > }; > > @@ -59,7 +61,7 @@ static table_entry_t imximage_bootops[] = { > */ > static table_entry_t imximage_versions[] = { > {IMXIMAGE_V1, "", " (i.MX25/35/51 compatible)", }, > - {IMXIMAGE_V2, "", " (i.MX53 compatible)", }, > + {IMXIMAGE_V2, "", " (i.MX53/6 compatible)", }, > {-1, "", " (Invalid)", }, > }; > > diff --git a/tools/imximage.h b/tools/imximage.h > index d126a46..d784a8d 100644 > --- a/tools/imximage.h > +++ b/tools/imximage.h > @@ -37,6 +37,8 @@ > #define FLASH_OFFSET_SD FLASH_OFFSET_STANDARD > #define FLASH_OFFSET_SPI FLASH_OFFSET_STANDARD > #define FLASH_OFFSET_ONENAND 0x100 > +#define FLASH_OFFSET_NOR 0x1000 > +#define FLASH_OFFSET_SATA FLASH_OFFSET_STANDARD > > #define IVT_HEADER_TAG 0xD1 > #define IVT_VERSION 0x40 Acked-by: Jason Liu > -- > 1.7.0.4 > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/5] i.mx6q: mx6qsabrelite: Update the network configuration
On Fri, Jan 13, 2012 at 8:10 PM, Dirk Behme wrote: > From: Troy Kisky > > Enable the usage of PHY_MICREL_KSZ9021, force the master mode and > minimize the tx clock delay. > > There is an issue with the gigabit ethernet mode at the SabreLite boards: > When operating on a Gb LAN, the FEC occasionally receives packets larger > than the MTU that appear to be caused by concatenation of multiple > received packets into one. > The problem was identified on the phy side. The current schematic has the > center tap pin 9 of the MAG/JAC USB combo to 3.3 filtered supply. Letting > this pin float solves the problem. > > Signed-off-by: Troy Kisky > CC: Troy Kisky > CC: Stefano Babic > CC: Jason Liu > --- > Note: This patch depends on the basic SabreLite ethernet patch > http://patchwork.ozlabs.org/patch/135744/ > > board/freescale/mx6qsabrelite/mx6qsabrelite.c | 8 ++-- > include/configs/mx6qsabrelite.h | 1 + > 2 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c > b/board/freescale/mx6qsabrelite/mx6qsabrelite.c > index d80165e..7879049 100644 > --- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c > +++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c > @@ -193,13 +193,17 @@ int board_mmc_init(bd_t *bis) > > int fecmxc_mii_postcall(int phy) > { > - /* prefer master mode */ > - miiphy_write("FEC", phy, MII_1000BASET_CTRL, 0x0f00); > + /* force master mode */ > + miiphy_write("FEC", phy, MII_1000BASET_CTRL, 0x1f00); > > /* min rx data delay */ > miiphy_write("FEC", phy, MII_EXTENDED_CTRL, 0x8105); > miiphy_write("FEC", phy, MII_EXTENDED_DATAW, 0x); > > + /* min tx data delay */ > + miiphy_write("FEC", phy, MII_EXTENDED_CTRL, 0x8106); > + miiphy_write("FEC", phy, MII_EXTENDED_DATAW, 0x); > + > /* max rx/tx clock delay, min rx/tx control delay */ > miiphy_write("FEC", phy, MII_EXTENDED_CTRL, 0x8104); > miiphy_write("FEC", phy, MII_EXTENDED_DATAW, 0xf0f0); > diff --git a/include/configs/mx6qsabrelite.h b/include/configs/mx6qsabrelite.h > index 840e271..6a29142 100644 > --- a/include/configs/mx6qsabrelite.h > +++ b/include/configs/mx6qsabrelite.h > @@ -66,6 +66,7 @@ > #define CONFIG_FEC_XCV_TYPE RGMII > #define CONFIG_ETHPRIME "FEC" > #define CONFIG_FEC_MXC_PHYADDR 6 > +#define CONFIG_PHY_MICREL_KSZ9021 Acked-by: Jason Liu > > /* allow to overwrite serial and ethaddr */ > #define CONFIG_ENV_OVERWRITE > -- > 1.7.0.4 > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] i.mx6q: configs: Add fdt_high and initrd_high variables
On Fri, Jan 13, 2012 at 5:49 PM, Dirk Behme wrote: > To be able to load the device tree and initrd correctly, set > the fdt_high and initrd_high environment variables. > > Using 0x implies that the device tree and the initrd > are initially copied to working addresses. This will avoid an > additional copy. > > Loading the device tree to 0x3000 and the initrd to 0x3c00 > should work for both boards, the ARM2 and SabreLite. > > Example (SabreLite): > > fatload mmc 0:2 0x1000 uImage > fatload mmc 0:2 0x3c00 uInitrd > fatload mmc 0:2 0x3000 board.dtb > bootm 0x1000 0x3c00 0x3000 > > Note: This requires that the kernel has CONFIG_HIGHMEM enabled. > > Signed-off-by: Dirk Behme > CC: Jason Liu > CC: Stefano Babic > --- > Note: This patch is against the recent head of u-boot-imx.git including > the SabreLite support: > > 5b894e4d00ff94a221f8cc23d54d08b889f54190 > i.mx: i.mx6q: add the initial support for i.mx6q Sabre Lite board > > Note: tools/checkpatch.pl reports 0 errors, 0 warnings > Acked-by: Jason Liu > 1.7.0.4 > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] i.mx6q: mx6qsabrelite: Setup uart1 pinmux
On Fri, Jan 13, 2012 at 5:49 PM, Dirk Behme wrote: > From: Troy Kisky > > This allows the Linux kernel to use UART1 before pinmux > support is added for UART1 > > Signed-off-by: Troy Kisky > CC: Troy Kisky > CC: Jason Liu > CC: Stefano Babic > --- > Note: This patch is against the recent head of u-boot-imx.git including > the SabreLite support: > > 5b894e4d00ff94a221f8cc23d54d08b889f54190 > i.mx: i.mx6q: add the initial support for i.mx6q Sabre Lite board > > Note: tools/checkpatch.pl reports 0 errors, 0 warnings > Acked-by: Jason Liu > board/freescale/mx6qsabrelite/mx6qsabrelite.c | 6 ++ > 1 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c > b/board/freescale/mx6qsabrelite/mx6qsabrelite.c > index 4028789..233e652 100644 > --- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c > +++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c > @@ -47,6 +47,11 @@ int dram_init(void) > return 0; > } > > +iomux_v3_cfg_t uart1_pads[] = { > + MX6Q_PAD_SD3_DAT6__UART1_RXD | MUX_PAD_CTRL(UART_PAD_CTRL), > + MX6Q_PAD_SD3_DAT7__UART1_TXD | MUX_PAD_CTRL(UART_PAD_CTRL), > +}; > + > iomux_v3_cfg_t uart2_pads[] = { > MX6Q_PAD_EIM_D26__UART2_TXD | MUX_PAD_CTRL(UART_PAD_CTRL), > MX6Q_PAD_EIM_D27__UART2_RXD | MUX_PAD_CTRL(UART_PAD_CTRL), > @@ -74,6 +79,7 @@ iomux_v3_cfg_t usdhc4_pads[] = { > > static void setup_iomux_uart(void) > { > + imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads)); > imx_iomux_v3_setup_multiple_pads(uart2_pads, ARRAY_SIZE(uart2_pads)); > } > > -- > 1.7.0.4 > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] i.mx6: mx6x_pins: Fix uart txd definitions
On Fri, Jan 13, 2012 at 5:49 PM, Dirk Behme wrote: > From: Troy Kisky > > The uart txd pad can also provide the rxd function. But it does not stop its > tx role. This could be used for a half duplex serial port. > > Change names to reduce confusion. > > Signed-off-by: Troy Kisky > CC: Troy Kisky > CC: Jason Liu > CC: Stefano Babic > --- Acked-by: Jason Liu > 1.7.0.4 > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/4] Add USB support to orion5x and edminiv2
Hi Prafulla, Le 16/01/2012 09:32, Prafulla Wadaskar a écrit : -Original Message- From: Albert ARIBAUD [mailto:albert.u.b...@aribaud.net] Sent: 16 January 2012 14:00 To: Prafulla Wadaskar Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH 0/4] Add USB support to orion5x and edminiv2 Hi Prafulla, Le 16/01/2012 09:20, Prafulla Wadaskar a écrit : -Original Message- From: u-boot-boun...@lists.denx.de [mailto:u-boot- boun...@lists.denx.de] On Behalf Of Albert ARIBAUD Sent: 16 January 2012 13:39 To: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 0/4] Add USB support to orion5x and edminiv2 This patch set adds USB support to the LaCie ED Mini V2 by renaming the 'kirkwood' USB driver a 'marvell' USB driver, sharing it between the orion5x SoC family and enabling it for the edminiv2 board. (this is similar to what was done with the 'mvgbe' driver in commits 9b6bcdcb to ab9164d0) Hi Albert This is patch series tested on both the platforms- Kirkwood, Orion for this change? Otherwise, Acked-by: Prafulla Wadaskar Regards.. Prafulla . .. For kirkwood the code is just a bunch of renames with no functional impact, but I did test the patch set on kirkwood for build-time and run-time regressions while developing it. However, since then I have rebased it a couple of times, and my openrd-client is currently not available for testing again. Could you possibly test it? Okay I will do it in next week is that okay with you? Don't bother: I've been lent another open-rd and I could run the u-boot image through openocd during lunch break. I've just tested usb start, usb tree with a mass storage USB key plugged in, usb info, usb part) and all works fine. Regards.. Prafulla . . Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] common/image.c: align usage of fdt_high with initrd_high
Gentle ping? Regards, Shawn On Tue, Jan 10, 2012 at 03:54:08PM +0800, Shawn Guo wrote: > The commit message of a28afca (Add uboot "fdt_high" enviroment variable) > states that fdt_high behaves similarly to the existing initrd_high. > But fdt_high actually has an outstanding difference from initrd_high. > The former specifies the start address, while the later specifies the > end address. > > As fdt_high and initrd_high will likely be used together, it'd be nice > to have them behave same. The patch changes the behavior of fdt_high > to have it aligned with initrd_high. > > The document of fdt_high in README is updated with an example to > demonstrate the usage of this environment variable. > > Signed-off-by: Shawn Guo > --- > Changes since v3: > * Fix the bug in case fdt_high=0x introduced by v1/v2. > > README |8 > common/image.c | 12 +--- > 2 files changed, 13 insertions(+), 7 deletions(-) > > diff --git a/README b/README > index ff72e47..1c3713c 100644 > --- a/README > +++ b/README > @@ -3619,6 +3619,14 @@ List of environment variables (most likely not > complete): > >fdt_high - if set this restricts the maximum address that the > flattened device tree will be copied into upon boot. > + For example, if you have a system with 1 GB memory > + at physical address 0x1000, while Linux kernel > + only recognizes the first 704 MB as low memory, you > + may need to set fdt_high as 0x3C00 to have the > + device tree blob be copied to the maximum address > + of the 704 MB low memory, so that Linux kernel can > + access it during the boot procedure. > + > If this is set to the special value 0x then > the fdt will not be copied at all on boot. For this > to work it must reside in writable memory, have > diff --git a/common/image.c b/common/image.c > index 77ca6e4..8c4137c 100644 > --- a/common/image.c > +++ b/common/image.c > @@ -1288,16 +1288,14 @@ int boot_relocate_fdt(struct lmb *lmb, char > **of_flat_tree, ulong *of_size) > > if (((ulong) desired_addr) == ~0UL) { > /* All ones means use fdt in place */ > - desired_addr = fdt_blob; > + of_start = fdt_blob; > + lmb_reserve(lmb, (ulong)of_start, of_len); > disable_relocation = 1; > - } > - if (desired_addr) { > + } else if (desired_addr) { > of_start = > (void *)(ulong) lmb_alloc_base(lmb, of_len, 0x1000, > -((ulong) > - desired_addr) > -+ of_len); > - if (desired_addr && of_start != desired_addr) { > +(ulong)desired_addr); > + if (of_start == 0) { > puts("Failed using fdt_high value for Device > Tree"); > goto error; > } > -- > 1.7.4.1 > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] SPI Test
On 16.01.2012 12:23, Marek Vasut wrote: >> Hmm, >> >> can you tell me what type of SPI flash you have installed? >> Typically the read-status-register operation requires a low to high >> transition to get terminated. This is from my flash' datasheet: >> >> Read-Status-Register (RDSR) >> The Read-Status-Register (RDSR) instruction allows reading of the status >> register. The status register >> may be read at any time even during a Write (Program/Erase) operation. >> When a Write operation is in >> progress, the Busy bit may be checked before sending any new commands to >> assure that the new >> commands are properly received by the device. CE# must be driven low >> before the RDSR instruction is >> entered and remain low until the status data is read. >> Read-Status-Register is continuous with ongoing >> clock cycles until it is terminated by a low to high transition of the >> CE#. See Figure 16 for the RDSR instruction sequence... >> It's a SST part. > > I just noticed ... Matthias, why don't you CC the mailing list? Fabio wanted to stop the list being flood with this discussion. But you are right. Let's stop this thread an return to the list. Matthias > > Also, I can't really remember now what part there is. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] net: move bootfile/ipaddr init into eth_initialize
Dear Mike Frysinger, In message <201201160505.17834.vap...@gentoo.org> you wrote: > > > The code which you remove here does NOT depend on CONFIG_CMD_NET; > > note that this is intentional. > > i noticed that, however, i'm not sure it matters. i can't find any place in > u- > boot that actually reads this variable. For example, the "bdinfo" command prints it; see common/cmd_bdinfo.c Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de I can't understand it. I can't even understand the people who can understand it.- Queen Juliana of the Netherlands. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] SPI Test
> On 15.01.2012 19:49, Marek Vasut wrote: > >> On 01/15/2012 05:08 PM, Fabio Estevam wrote: > >>> On Sun, Jan 15, 2012 at 10:31 AM, Matthias Fuchs > >>> > > > > wrote: > -> finally we only need to deassert chip select. But the mxs_spi > driver -> does not support this operation without doing a byte > transfer. > > spi_xfer(spi, 0, NULL, NULL, SPI_XFER_END); > >>> > >>> Ok, so this is the point we need to fix in the mxs spi driver then. > >>> > >>> How about: > >>> > >>> diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c > >>> index 4c27fef..bb1804e 100644 > >>> --- a/drivers/spi/mxs_spi.c > >>> +++ b/drivers/spi/mxs_spi.c > >>> @@ -130,12 +130,6 @@ int spi_xfer(struct spi_slave *slave, unsigned int > >>> bitlen, > >>> > >>> const char *tx = dout; > >>> char *rx = din; > >>> > >>> - if (bitlen == 0) > >>> - return 0; > >>> - > >>> - if (!rx && !tx) > >>> - return 0; > >>> - > >>> > >>> if (flags & SPI_XFER_BEGIN) > >>> > >>> mxs_spi_start_xfer(ssp_regs); > >>> > >>> @@ -143,9 +137,6 @@ int spi_xfer(struct spi_slave *slave, unsigned int > >>> bitlen, > >>> > >>> /* We transfer 1 byte */ > >>> writel(1, &ssp_regs->hw_ssp_xfer_size); > >>> > >>> - if ((flags & SPI_XFER_END) && !len) > >>> - mxs_spi_end_xfer(ssp_regs); > >>> - > >>> > >>> if (tx) > >>> > >>> writel(SSP_CTRL0_READ, > >>> &ssp_regs->hw_ssp_ctrl0_clr); > >>> > >>> else > >>> > >>> @@ -181,6 +172,9 @@ int spi_xfer(struct spi_slave *slave, unsigned int > >>> bitlen, > >>> > >>> return -1; > >>> > >>> } > >>> > >>> } > >>> > >>> + > >>> + if (flags & SPI_XFER_END) > >>> + mxs_spi_end_xfer(ssp_regs); > >>> > >>> return 0; > >>> > >>> } > >>> > >>> This makes sure that mxs_spi_end_xfer will be also called in the case > >>> where bitlen==0 and tx and rx== NULL, which is the case for > >>> spi_xfer(spi, 0, NULL, NULL, SPI_XFER_END); > >>> > So I think we need to ask someone from Freescale for a manual abort or > stay with my patch. Again, I agree, that it is not a shiny solution. > But it works. > >>> > >>> I think that mxs_spi_end_xfer does the chip select deassertion > >>> correctly based on the reference manual. > >> > >> I don't think so! There must be a transfer after calling it. > >> > >>> The issue I see with current implementation is that mxs_spi_end_xfer > >>> is not called in the case where bitlen==0 and tx/rx == NULL. > >> > >> That's true. But it's now the main problem :-) > >> > >>> The suggestion I sent above tries to address this problem. > >>> > >>> I will try to populate a SPI NOR on my mx28evk next week and try to > >>> take a look at this issue. > >> > >> Yes give it a try. > >> > >> Marek, did you made the M28EVK port? Did you really test t with an > >> SPI flash? > > > > Yes, I did test it. But I only have one device on the SPI bus so it > > doesn't matter if the CS remained asserted. > > Hmm, > > can you tell me what type of SPI flash you have installed? > Typically the read-status-register operation requires a low to high > transition to get terminated. This is from my flash' datasheet: > > Read-Status-Register (RDSR) > The Read-Status-Register (RDSR) instruction allows reading of the status > register. The status register > may be read at any time even during a Write (Program/Erase) operation. > When a Write operation is in > progress, the Busy bit may be checked before sending any new commands to > assure that the new > commands are properly received by the device. CE# must be driven low > before the RDSR instruction is > entered and remain low until the status data is read. > Read-Status-Register is continuous with ongoing > clock cycles until it is terminated by a low to high transition of the > CE#. See Figure 16 for the RDSR instruction sequence... > It's a SST part. I just noticed ... Matthias, why don't you CC the mailing list? Also, I can't really remember now what part there is. > > Matthias ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] fsl_pmic.h: add regulator mode 0 and 1 bits
Add bit definitions for register 32 and 33 of Freescale PMIC. Signed-off-by: Helmut Raiger --- include/fsl_pmic.h | 52 1 files changed, 52 insertions(+), 0 deletions(-) diff --git a/include/fsl_pmic.h b/include/fsl_pmic.h index 742f2e1..17e7b82 100644 --- a/include/fsl_pmic.h +++ b/include/fsl_pmic.h @@ -102,6 +102,58 @@ enum { PMIC_NUM_OF_REGS, }; +/* REG_MODE_0 */ +#define VAUDIOEN (1 << 0) +#define VAUDIOSTBY (1 << 1) +#define VAUDIOMODE (1 << 2) +#define VIOHIEN(1 << 3) +#define VIOHISTBY (1 << 4) +#define VIOHIMODE (1 << 5) +#define VIOLOEN(1 << 6) +#define VIOLOSTBY (1 << 7) +#define VIOLOMODE (1 << 8) +#define VDIGEN (1 << 9) +#define VDIGSTBY (1 << 10) +#define VDIGMODE (1 << 11) +#define VGENEN (1 << 12) +#define VGENSTBY (1 << 13) +#define VGENMODE (1 << 14) +#define VRFDIGEN (1 << 15) +#define VRFDIGSTBY (1 << 16) +#define VRFDIGMODE (1 << 17) +#define VRFREFEN (1 << 18) +#define VRFREFSTBY (1 << 19) +#define VRFREFMODE (1 << 20) +#define VRFCPEN(1 << 21) +#define VRFCPSTBY (1 << 22) +#define VRFCPMODE (1 << 23) + +/* REG_MODE_1 */ +#define VSIMEN (1 << 0) +#define VSIMSTBY (1 << 1) +#define VSIMMODE (1 << 2) +#define VESIMEN(1 << 3) +#define VESIMSTBY (1 << 4) +#define VESIMMODE (1 << 5) +#define VCAMEN (1 << 6) +#define VCAMSTBY (1 << 7) +#define VCAMMODE (1 << 8) +#define VRFBGEN(1 << 9) +#define VRFBGSTBY (1 << 10) +#define VVIBEN (1 << 11) +#define VRF1EN (1 << 12) +#define VRF1STBY (1 << 13) +#define VRF1MODE (1 << 14) +#define VRF2EN (1 << 15) +#define VRF2STBY (1 << 16) +#define VRF2MODE (1 << 17) +#define VMMC1EN(1 << 18) +#define VMMC1STBY (1 << 19) +#define VMMC1MODE (1 << 20) +#define VMMC2EN(1 << 21) +#define VMMC2STBY (1 << 22) +#define VMMC2MODE (1 << 23) + /* REG_POWER_MISC */ #define GPO1EN (1 << 6) #define GPO1STBY (1 << 7) -- 1.7.4.4 -- Scanned by MailScanner. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2] tt01: add MMC support
board_mmc_init() initializes the pins of SDHC1 and turns on V_MMC1 of the PMIC. Config adds support for EXT2 and FAT. Signed-off-by: Helmut Raiger --- V2: pmic_reg_(read|write) use constants from fsl_pmic.h now board/hale/tt01/tt01.c | 54 ++- include/configs/tt01.h | 12 ++ 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/board/hale/tt01/tt01.c b/board/hale/tt01/tt01.c index 2995c8f..10f4548 100644 --- a/board/hale/tt01/tt01.c +++ b/board/hale/tt01/tt01.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -175,8 +176,6 @@ int board_init(void) int board_late_init(void) { - pmic_init(); - #ifdef CONFIG_HW_WATCHDOG mxc_hw_watchdog_enable(); #endif @@ -190,6 +189,36 @@ int checkboard(void) return 0; } +#ifdef CONFIG_MXC_MMC +int board_mmc_init(bd_t *bis) +{ + u32 val; + struct pmic *p; + + /* + * this is the first driver to use the pmic, so call + * pmic_init() here. board_late_init() is too late for + * the MMC driver. + */ + pmic_init(); + p = get_pmic(); + + /* configure pins for SDHC1 only */ + mx31_gpio_mux(IOMUX_MODE(MUX_CTL_SD1_CLK, MUX_CTL_FUNC)); + mx31_gpio_mux(IOMUX_MODE(MUX_CTL_SD1_CMD, MUX_CTL_FUNC)); + mx31_gpio_mux(IOMUX_MODE(MUX_CTL_SD1_DATA0, MUX_CTL_FUNC)); + mx31_gpio_mux(IOMUX_MODE(MUX_CTL_SD1_DATA1, MUX_CTL_FUNC)); + mx31_gpio_mux(IOMUX_MODE(MUX_CTL_SD1_DATA2, MUX_CTL_FUNC)); + mx31_gpio_mux(IOMUX_MODE(MUX_CTL_SD1_DATA3, MUX_CTL_FUNC)); + + /* turn on power V_MMC1 */ + if (pmic_reg_read(p, REG_MODE_1, &val) < 0) + pmic_reg_write(p, REG_MODE_1, val | VMMC1EN); + + return mxc_mmc_init(bis); +} +#endif + int board_eth_init(bd_t *bis) { int rc = 0; @@ -198,3 +227,24 @@ int board_eth_init(bd_t *bis) #endif return rc; } + +#ifdef CONFIG_CONSOLE_EXTRA_INFO +void video_get_info_str(int line_number, char *info) +{ + u32 srev = get_cpu_rev(); + + switch (line_number) { + case 2: + sprintf(info, " CPU : Freescale i.MX31 rev %d.%d%s at %d MHz", + (srev & 0xF0) >> 4, (srev & 0x0F), + ((srev & 0x8000) ? " unknown" : ""), + mxc_get_clock(MXC_ARM_CLK) / 100); + break; + case 3: + strcpy(info, " " BOARD_STRING); + break; + default: + info[0] = 0; + } +} +#endif diff --git a/include/configs/tt01.h b/include/configs/tt01.h index a553712..6846816 100644 --- a/include/configs/tt01.h +++ b/include/configs/tt01.h @@ -180,6 +180,11 @@ #define CONFIG_SMC911X_BASE(CS4_BASE+0x20) #define CONFIG_SMC911X_16_BIT +/* mmc driver */ +#define CONFIG_MMC +#define CONFIG_GENERIC_MMC +#define CONFIG_MXC_MMC +#define CONFIG_MXC_MCI_REGS_BASE SDHC1_BASE_ADDR /* * Command definition */ @@ -229,6 +234,13 @@ #define CONFIG_CMDLINE_EDITING +/* MMC boot support */ +#define CONFIG_CMD_MMC +#define CONFIG_DOS_PARTITION +#define CONFIG_EFI_PARTITION +#define CONFIG_CMD_EXT2 +#define CONFIG_CMD_FAT + #define CONFIG_NAND_MXC #define CONFIG_SYS_MAX_NAND_DEVICE 1 #define CONFIG_SYS_NAND_MAX_CHIPS 1 -- 1.7.4.4 -- Scanned by MailScanner. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2] tt01: add MMC support
Modification suggested by Stefano. [PATCH 1/2] fsl_pmic.h: add regulator mode 0 and 1 bits [PATCH 2/2] tt01: add MMC support -- Scanned by MailScanner. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ARM: omap3: temporary disable USB on TAM3517 boards
Dear Stefano Babic, In message <1326704008-18464-1-git-send-email-sba...@denx.de> you wrote: > > +#undef CONFIG_CMD_USB > +#ifdef CONFIG_CMD_USB Please do not undef what is not defined in the first place. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Boss, n.: According to the Oxford English Dictionary, in the Middle Ages the words "boss" and "botch" were largely synonymous, except that boss, in addition to meaning "a supervisor of workers" also meant "an ornamental stud." ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] net: move bootfile/ipaddr init into eth_initialize
On Monday 16 January 2012 03:03:23 Wolfgang Denk wrote: > Mike Frysinger wrote: > > All arches init these variables the same way, so move the logic > > into the core net code to avoid duplicating it everywhere else. > > This is the wrong approach. > > There are many more ieces of code in arch/*/lib/board.c which are > duplicated across some or all architectures. Instread of ripping > these apart and fixing a bit here and a bit thre we should combine > efforts and merge all arch/*/lib/board.c into a common file. or, if we add bit by bit, we have an easily testable solution rather than one giant leap > > --- a/arch/arm/lib/board.c > > +++ b/arch/arm/lib/board.c > > @@ -536,9 +536,6 @@ void board_init_r(gd_t *id, ulong dest_addr) > > > > arm_pci_init(); > > > > #endif > > > > - /* IP Address */ > > - gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr"); > > The code which you remove here does NOT depend on CONFIG_CMD_NET; > note that this is intentional. i noticed that, however, i'm not sure it matters. i can't find any place in u- boot that actually reads this variable. arch/*/include/asm/u-boot.h: bi_ip_addr is declared as part of bd_t arch/*/lib/board.c: bi_ip_addr gets initialized based on env common/cmd_bdinfo.c: the value of bi_ip_addr gets displayed common/cmd_nvedit.c: bi_ip_addr gets written when user does "setenv ipaddr" board/esd/cpci405/cpci405.c: bi_ip_addr is written via the env net/net.c: bi_ip_addr gets written as part of global env sync is there any reason i shouldn't just rip out all bi_ip_addr handling ? -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2] add new board vl_ma2sc
* add support for board VL+MA2SC * adds vl_ma2sc_config for standard NOR boot configuration * adds vl_ma2sc_ram_config for RAM load configuration Signed-off-by: Jens Scharsig --- Changes since V1: * remove dead targets from Makefile * remove fantasy mac address from config * fix: codesyle 0 warnings/error with checkpatch MAINTAINERS |1 + board/BuS/vl_ma2sc/Makefile | 48 board/BuS/vl_ma2sc/vl_ma2sc.c | 551 + boards.cfg|2 + include/configs/vl_ma2sc.h| 463 ++ 5 files changed, 1065 insertions(+), 0 deletions(-) create mode 100644 board/BuS/vl_ma2sc/Makefile create mode 100644 board/BuS/vl_ma2sc/vl_ma2sc.c create mode 100644 include/configs/vl_ma2sc.h diff --git a/MAINTAINERS b/MAINTAINERS index a5b728e..12047fc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -819,6 +819,7 @@ Steve Sakoman Jens Scharsig eb_cpux9k2 ARM920T (AT91RM9200 SoC) + vl_ma2scARM926EJS (AT91SAM9263 SoC) Heiko Schocher diff --git a/board/BuS/vl_ma2sc/Makefile b/board/BuS/vl_ma2sc/Makefile new file mode 100644 index 000..1cadfb3 --- /dev/null +++ b/board/BuS/vl_ma2sc/Makefile @@ -0,0 +1,48 @@ +# +# (C) Copyright 2003-2008 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de. +# +# (C) Copyright 2009-2012 +# Jens Scharsig +# BuS Elektronik GmbH & Co. KG +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS += vl_ma2sc.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/BuS/vl_ma2sc/vl_ma2sc.c b/board/BuS/vl_ma2sc/vl_ma2sc.c new file mode 100644 index 000..62ed6fb --- /dev/null +++ b/board/BuS/vl_ma2sc/vl_ma2sc.c @@ -0,0 +1,551 @@ +/* + * (C) Copyright 2009-2012 + * Jens Scharsig + * BuS Elektronik GmbH & Co. KG + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB) +#include +#endif +#include + +DECLARE_GLOBAL_DATA_PTR; + +#ifdef CONFIG_CMD_NAND +static void vl_ma2sc_nand_hw_init(void) +{ + unsigned long csa; + at91_smc_t *smc= (at91_smc_t *) ATMEL_BASE_SMC0; + at91_matrix_t *matrix = (at91_matrix_t *) ATMEL_BASE_MATRIX; + at91_pmc_t *pmc= (at91_pmc_t *) ATMEL_BASE_PMC; + + at91_set_pio_output(AT91_PIO_PORTA, 13, 1); /* CAN_TX -> H */ + at91_set_pio_output(AT91_PIO_PORTA, 12, 1); /* CAN_STB -> H */ + at91_set_pio_output(AT91_PIO_PORTA, 11, 1); /* CAN_EN -> H */ + + /* Enable CS3 */ + csa = readl(&matrix->csa[0]) | AT91_MATRIX_CSA_EBI_CS3A; + writel(csa, &matrix->csa[0]); + + /* Configure SMC CS3 for NAND/SmartMedia */ + writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) | + AT91_SMC_SETUP_NRD(1) | AT91_SMC_S
Re: [U-Boot] [PATCH V4 2/2] ext4fs write support
On Monday 16 January 2012 02:58:20 Wolfgang Denk wrote: > Mike Frysinger wrote: > > > +ifndef CONFIG_CMD_EXT4 > > > +COBJS-$(CONFIG_CMD_EXT4_WRITE) += cmd_ext4.o > > > +endif > > > > the CONFIG_CMD_EXT4 check is not necessary. if someone tries to enable > > CONFIG_CMD_EXT4_WRITE but not CONFIG_CMD_EXT4, that's their fault. > > we can try to be a bit user-friendly at least and throw a compile time > error message. i'm fine with that. i just don't think this checking belongs in the Makefiles. -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V4 1/2] ehci-omap: driver for EHCI host on OMAP3
On 16/01/2012 08:58, Govindraj wrote: > Th v2 patch series [1] posted is based on top of this patch. If I understand well, we need in any case Ilya's patch. In this case, it is maybe worth to merge Ilya's patch in the meanwhile (and please drop my patch that remove USB support from TAM3517 boards). Best regards, Stefano -- = DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: off...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] add new board vl_ma2sc
On Monday 16 January 2012 02:41:24 Jens Scharsig wrote: > --- /dev/null > +++ b/board/BuS/vl_ma2sc/Makefile > > +clean: > + rm -f $(SOBJS) $(OBJS) > + > +distclean: clean > + rm -f $(LIB) core *.bak $(obj).depend dead targets -> delete them -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] add new board vl_ma2sc
Hello Jens, Jens Scharsig wrote: > Hello Heiko: >> Please check your patch with tools/checkpatch, it shows a lot >> of warnings: >> >> [hs@pollux u-boot]$ ./tools/checkpatch.pl index.html >> [...] >> total: 17 errors, 13 warnings, 1131 lines checked >> > The error based on the two code sequences > > > > vidinfo_t panel_info = { > vl_col: 320, > vl_row: 240, > vl_clk: 650, > vl_sync:ATMEL_LCDC_INVDVAL_INVERTED | > ATMEL_LCDC_INVLINE_INVERTED | > ATMEL_LCDC_INVVD_INVERTED | > ATMEL_LCDC_INVFRAME_INVERTED, > vl_bpix:(ATMEL_LCDC_PIXELSIZE_8 >> 5), > vl_tft: 1, > vl_hsync_len: 5, /* Horiz Sync Pulse Width */ > vl_left_margin: 68, /* horiz back porch */ > vl_right_margin:20, /* horiz front porch */ > vl_vsync_len: 2, /* vert Sync Pulse Width */ > vl_upper_margin:18, /* vert back porch */ > vl_lower_margin:4, /* vert front porch */ > mmio: ATMEL_BASE_LCDC, > }; Try: vidinfo_t panel_info = { .vl_col = 320, [...] > > > This block i have "stolen" from at91sam9263 board. > > and > > #define CONFIG_ETHADDR00:4D:41:02:52:43 /* MA2SC */ > > > Can your teach me the right format for things like this? Hmm.. fix ethaddr in config file? I am not sure, if this is allowed in mainline ... bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] add new board vl_ma2sc
Hello Heiko: > > Please check your patch with tools/checkpatch, it shows a lot > of warnings: > > [hs@pollux u-boot]$ ./tools/checkpatch.pl index.html > [...] > total: 17 errors, 13 warnings, 1131 lines checked > The error based on the two code sequences vidinfo_t panel_info = { vl_col: 320, vl_row: 240, vl_clk: 650, vl_sync:ATMEL_LCDC_INVDVAL_INVERTED | ATMEL_LCDC_INVLINE_INVERTED | ATMEL_LCDC_INVVD_INVERTED | ATMEL_LCDC_INVFRAME_INVERTED, vl_bpix:(ATMEL_LCDC_PIXELSIZE_8 >> 5), vl_tft: 1, vl_hsync_len: 5, /* Horiz Sync Pulse Width */ vl_left_margin: 68, /* horiz back porch */ vl_right_margin:20, /* horiz front porch */ vl_vsync_len: 2, /* vert Sync Pulse Width */ vl_upper_margin:18, /* vert back porch */ vl_lower_margin:4, /* vert front porch */ mmio: ATMEL_BASE_LCDC, }; This block i have "stolen" from at91sam9263 board. and #define CONFIG_ETHADDR 00:4D:41:02:52:43 /* MA2SC */ Can your teach me the right format for things like this? Thanks Jens Scharsig ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] net: move bootfile/ipaddr init into eth_initialize
Dear Mike Frysinger, In message <1326670329-18644-1-git-send-email-vap...@gentoo.org> you wrote: > All arches init these variables the same way, so move the logic > into the core net code to avoid duplicating it everywhere else. This is the wrong approach. There are many more ieces of code in arch/*/lib/board.c which are duplicated across some or all architectures. Instread of ripping these apart and fixing a bit here and a bit thre we should combine efforts and merge all arch/*/lib/board.c into a common file. Additionally, your patch potentially breaks a number of boards. > index 3d78274..2c4276b 100644 > --- a/arch/arm/lib/board.c > +++ b/arch/arm/lib/board.c > @@ -536,9 +536,6 @@ void board_init_r(gd_t *id, ulong dest_addr) > arm_pci_init(); > #endif > > - /* IP Address */ > - gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr"); The code which you remove here does NOT depend on CONFIG_CMD_NET; note that this is intentional. When moving this into net/eth.c, it will be missing for all oards that do not have CONFIG_CMD_NET defined. So NAK. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de An Ada exception is when a routine gets in trouble and says 'Beam me up, Scotty'. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] OMAP3 performance regression in 2011.12
-Original Message- From: Philip Balister To: Joe Woodward Date: Fri, 13 Jan 2012 15:53:37 -0500 Subject: Re: OMAP3 performance regression in 2011.12 > Did you find out anymore info on this? I may have a customer who is > seeing this on a 3.o based overo. > (CC'ing in the mailing list again). Sadly not, no more replies to this. I think either this change needs reverting (but that'll break OMAP4) or at least encasing in #ifdefs so that it isn't applied for OMAP3. I was going to ask on the Linux OMAP mailing list if the L2/outer cache is enabled on OMAP3 in Linux but haven't got round to it yet! Cheers, Joe > Philip > > On 01/09/2012 10:48 AM, Joe Woodward wrote: > >> -Original Message- > >> From: Tom Rini > >> To: Joe Woodward > >> Cc: u-boot@lists.denx.de > >> Date: Mon, 9 Jan 2012 08:11:07 -0700 > >> Subject: Re: [U-Boot] OMAP3 performance regression in 2011.12 > >> > >>> On Mon, Jan 9, 2012 at 3:27 AM, Joe Woodward > >> wrote: > Commit "armv7: disable L2 cache in cleanup_before_linux()" on 6th > >> Dec > >>> 2011 by Aneesh V adds the following: > > arch/arm/cpu/armv7/cpu.c:cleanup_before_linux() > > ... > v7_out_cache_disable(); > ... > > The commit message implies this change was to make booting > reliable > >>> on OMAP4 by disabling L2 cache before jumping to Linux. > > However, when running with a stock 3.2 Linux kernel on an OMAP3 it > >>> has the effect of massively reducing system performance (when > running > >>> using an OMAP3- > only 3.2 Linux Kernel on a GUSMTIX Overo OMAP3530). > > Therefore, I assume this means that the kernel isn't turning the > L2 > >>> cache back on for an OMAP3 (at least with my kernel build)! > > So, my question is... > > Are there any Kconfig options in Linux that will re-enable the L2 > >>> cache (something obvious that I've missed), or is this commit just > >>> bad-news for OMAP3? > >>> > >>> Are you certain that this is the commit that's causing your > problem? > >>> The kernel is responsible for turning the cache back on and has for > a > >>> long time, iirc. > >>> > >>> -- > >>> Tom > > > > (apologies for previous top posting, wasn't paying attention to what > I was doing!) > > > > I'm fairly certain... > > > > If I take the 2011.12 uBoot release the kernel takes about twice the > time to boot (compared to 2011.09), and the device is noticably slower. > > > > Then if I comment out the v7_out_cache_disable() line in cpu.c and > rebuild uBoot then everything speeds up again. > > > > I thought the kernel would turn on the cache again too... > > > > Is there any easy way from userspace to determine if the cache is on? > > > > I did a bit of Googling and found: > > http://www.spinics.net/lists/arm-kernel/msg50064.html > > http://www.spinics.net/lists/arm-kernel/msg50083.html > > > > It may be that the kernel is re-enabling the L1 cache, but expecting > L2 to be on? > > Or the way v7_out_cache_disable() disables L2 is not compatible with > the way the kernel expects to re-enable it? > > > > Also, in the Linux there seem to be OMAP4 specific functions for > re-enabling the L2 cache (omap4-common.c:omap_l2_cache_init()), but > none for OMAP3. I'm > > assuming this is because up to now OMAP3 is assumed to have the L2 > left enabled? Either that, or there is some generic Cortex-A8 method > for enabling the L2 > > cache in the kernel soures that I've not found... > > > > Cheers, > > Joe > > > >> > >> ___ > >> U-Boot mailing list > >> U-Boot@lists.denx.de > >> http://lists.denx.de/mailman/listinfo/u-boot > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] common, image: introduce new uimage types
Hello Wolfgang, Wolfgang Denk wrote: > Dear Heiko Schocher, > > In message <4f13c325.3010...@denx.de> you wrote: - ubootimage U-Boot image - splimage SPL image - dfenvimage Default Environment image - ublheader TI davinci UBL header image >>> for ... ? >> Oh, right, forgotten to add this in the commit message. >> >> They are needed for cam_enc_4xx update: >> >> http://patchwork.ozlabs.org/patch/136165/ >> >> There, the UBL-header, SPL-image, U-Boot image and an default image >> are wrapped in one FIT image. > > But this is conceptually broken. The IH_TYPE_* definitions are > actually only relevant for legacy images. > > FIX images use an XML based, extendable data format. The whole idea > of this is that we do NOT have to change to code when anybody needs a > new (probably private) entry or type or whatever. > > In your case, it should be possible to use an existing image type > (say, IH_TYPE_FIRMWARE) for your code, and use other distinguishing > marks to determine which parts you work on. Probably it makes sense > to define your own entry for each of the parts. Then only your own > code needs to understand this. Yep, you are right, rework this. bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] ARM: omap3: temporary disable USB on TAM3517 boards
The TAM3517 boards require a patch for EHCI OMAP that does not yet find a way to mainline. The patch disables temporary USB until EHCI OMAP will be supported. Signed-off-by: Stefano Babic Cc: Tom Rini Cc: Albert Aribaud --- include/configs/tam3517-common.h |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/configs/tam3517-common.h b/include/configs/tam3517-common.h index 817d468..081dbc8 100644 --- a/include/configs/tam3517-common.h +++ b/include/configs/tam3517-common.h @@ -97,12 +97,16 @@ #define CONFIG_DOS_PARTITION /* EHCI */ +#undef CONFIG_CMD_USB +#ifdef CONFIG_CMD_USB #define CONFIG_OMAP3_GPIO_5 #define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_OMAP -#define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 25 #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3 #define CONFIG_USB_STORAGE +#endif + +#define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 25 /* #define CONFIG_EHCI_DCACHE */ @@ -121,7 +125,6 @@ #define CONFIG_CMD_NFS #define CONFIG_CMD_NAND/* NAND support */ #define CONFIG_CMD_PING -#define CONFIG_CMD_USB #undef CONFIG_CMD_FLASH/* only NAND on the SOM */ #undef CONFIG_CMD_IMLS -- 1.7.5.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] common, image: introduce new uimage types
Dear Heiko Schocher, In message <4f13c325.3010...@denx.de> you wrote: > > >> - ubootimage > >> U-Boot image > >> - splimage > >> SPL image > >> - dfenvimage > >> Default Environment image > >> - ublheader > >> TI davinci UBL header image > > > > for ... ? > > Oh, right, forgotten to add this in the commit message. > > They are needed for cam_enc_4xx update: > > http://patchwork.ozlabs.org/patch/136165/ > > There, the UBL-header, SPL-image, U-Boot image and an default image > are wrapped in one FIT image. But this is conceptually broken. The IH_TYPE_* definitions are actually only relevant for legacy images. FIX images use an XML based, extendable data format. The whole idea of this is that we do NOT have to change to code when anybody needs a new (probably private) entry or type or whatever. In your case, it should be possible to use an existing image type (say, IH_TYPE_FIRMWARE) for your code, and use other distinguishing marks to determine which parts you work on. Probably it makes sense to define your own entry for each of the parts. Then only your own code needs to understand this. Thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Any time things appear to be going better, you have overlooked some- thing. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V13 04/14] devkit8000/spl: init GPMC for dm9000 in SPL
On 15/01/2012 20:47, Simon Schwarz wrote: > Jep - no one cared about the patch as far as i can see: > http://article.gmane.org/gmane.comp.boot-loaders.u-boot/119453 Bad...maybe it was woth to include it in the patchset, but it should be enough to mark it is required. > > I did a rebase - will send it on monday, setting up git send-email is > not the right thing for sunday evening > Ok. thanks ! Stefano -- = DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: off...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/4] Add USB support to orion5x and edminiv2
> -Original Message- > From: Albert ARIBAUD [mailto:albert.u.b...@aribaud.net] > Sent: 16 January 2012 14:00 > To: Prafulla Wadaskar > Cc: u-boot@lists.denx.de > Subject: Re: [U-Boot] [PATCH 0/4] Add USB support to orion5x and > edminiv2 > > Hi Prafulla, > > Le 16/01/2012 09:20, Prafulla Wadaskar a écrit : > > > > > >> -Original Message- > >> From: u-boot-boun...@lists.denx.de [mailto:u-boot- > >> boun...@lists.denx.de] On Behalf Of Albert ARIBAUD > >> Sent: 16 January 2012 13:39 > >> To: u-boot@lists.denx.de > >> Subject: [U-Boot] [PATCH 0/4] Add USB support to orion5x and > edminiv2 > >> > >> This patch set adds USB support to the LaCie ED Mini V2 by renaming > >> the 'kirkwood' USB driver a 'marvell' USB driver, sharing it > between > >> the orion5x SoC family and enabling it for the edminiv2 board. > >> > >> (this is similar to what was done with the 'mvgbe' driver in > commits > >> 9b6bcdcb to ab9164d0) > > > > Hi Albert > > This is patch series tested on both the platforms- Kirkwood, Orion > for this change? > > > > Otherwise, > > Acked-by: Prafulla Wadaskar > > > > Regards.. > > Prafulla . .. > > For kirkwood the code is just a bunch of renames with no functional > impact, but I did test the patch set on kirkwood for build-time and > run-time regressions while developing it. > > However, since then I have rebased it a couple of times, and my > openrd-client is currently not available for testing again. Could you > possibly test it? Okay I will do it in next week is that okay with you? Regards.. Prafulla . . > > Amicalement, > -- > Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/4] Add USB support to orion5x and edminiv2
Hi Prafulla, Le 16/01/2012 09:20, Prafulla Wadaskar a écrit : -Original Message- From: u-boot-boun...@lists.denx.de [mailto:u-boot- boun...@lists.denx.de] On Behalf Of Albert ARIBAUD Sent: 16 January 2012 13:39 To: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 0/4] Add USB support to orion5x and edminiv2 This patch set adds USB support to the LaCie ED Mini V2 by renaming the 'kirkwood' USB driver a 'marvell' USB driver, sharing it between the orion5x SoC family and enabling it for the edminiv2 board. (this is similar to what was done with the 'mvgbe' driver in commits 9b6bcdcb to ab9164d0) Hi Albert This is patch series tested on both the platforms- Kirkwood, Orion for this change? Otherwise, Acked-by: Prafulla Wadaskar Regards.. Prafulla . .. For kirkwood the code is just a bunch of renames with no functional impact, but I did test the patch set on kirkwood for build-time and run-time regressions while developing it. However, since then I have rebased it a couple of times, and my openrd-client is currently not available for testing again. Could you possibly test it? Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] edminiv2: add hush parser and long help
> -Original Message- > From: u-boot-boun...@lists.denx.de [mailto:u-boot- > boun...@lists.denx.de] On Behalf Of Albert ARIBAUD > Sent: 16 January 2012 13:15 > To: u-boot@lists.denx.de > Subject: [U-Boot] [PATCH] edminiv2: add hush parser and long help > > > Signed-off-by: Albert ARIBAUD > --- > include/configs/edminiv2.h |7 +++ > 1 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/include/configs/edminiv2.h b/include/configs/edminiv2.h > index 88d32b2..9134884 100644 > --- a/include/configs/edminiv2.h > +++ b/include/configs/edminiv2.h > @@ -221,6 +221,13 @@ > #define CONFIG_SYS_RESET_ADDRESS 0x > #define CONFIG_SYS_MAXARGS 16 > > +/* Use the HUSH parser */ > +#define CONFIG_SYS_HUSH_PARSER > +#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " > + > +/* provide extensive help */ > +#define CONFIG_SYS_LONGHELP > + > /* additions for new relocation code, must be added to all boards */ > #define CONFIG_SYS_SDRAM_BASE0 > #define CONFIG_SYS_INIT_SP_ADDR \ Acked-by: Prafulla Wadaskar Regards.. Prafulla . . . ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot