microblaze: Fix reset function
PATCH 1/4 microblaze: Fix reset function
From: Michal Simek <[email protected]>
Remove CONFIG_SYS_RESET_ADDRESS macro.
It was there from historical point of view when soft reset was just jump to u-boot text start (not used right now).
--- board/xilinx/microblaze-generic/microblaze-generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
board/xilinx/microblaze-generic/microblaze-generic.c +2 -2
@@ -38,10 +38,10 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) *((unsigned long *)(CONFIG_SYS_GPIO_0_ADDR )) = ++(*((unsigned long *)(CONFIG_SYS_GPIO_0_ADDR )));#endif -#ifdef CONFIG_SYS_RESET_ADDRESS +puts ("Reseting board\n" ); asm ("bra r0" ); -#endif +return 0 ; }
--
1.8.2.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130422/2cd578b0/attachment.pgp>
PATCH 2/4 microblaze: Enable netconsole
From: Michal Simek <[email protected]>
Setup environment and enable netconsole.
--- include/configs/microblaze-generic.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
include/configs/microblaze-generic.h +8 -1
@@ -414,10 +414,17 @@"nor0=flash-0\0" \"mtdparts=mtdparts=flash-0:" \"256k(u-boot),256k(env),3m(kernel)," \ - "1m(romfs),1m(cramfs),-(jffs2)\0" +"1m(romfs),1m(cramfs),-(jffs2)\0" \ +"nc=setenv stdout nc\;" \ +"setenv stdin nc\0" \ +"serial=setenv stdout serial;" \ + "setenv stdin serial\0"#define CONFIG_CMDLINE_EDITING +#define CONFIG_NETCONSOLE 1 +#define CONFIG_SYS_CONSOLE_IS_IN_ENV 1 +/* Use the HUSH parser */ #define CONFIG_SYS_HUSH_PARSER
--
1.8.2.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130422/3849fbf8/attachment.pgp>
PATCH 3/4 microblaze: Disable all cpu features before reset
In reply to Michal SimekFrom: Michal Simek <[email protected]>
Fix microblaze soft reset function and disable all cpu features. Especially disable caches because IRQs were off by disable_interrupts().
--- board/xilinx/microblaze-generic/microblaze-generic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
board/xilinx/microblaze-generic/microblaze-generic.c +2 -1
@@ -40,7 +40,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])#endif puts ("Reseting board\n" ); - asm ("bra r0" ); + __asm__ __volatile__ (" mts rmsr, r0;" \ +"bra r0" );return 0 ; }
--
1.8.2.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130422/80aa2046/attachment.pgp>
PATCH 4/4 watchdog: Add support for Xilinx Microblaze watchdog
In reply to Michal SimekWatchdog can be used on Microblaze, PPC and Zynq hw designs.
--- arch/microblaze/include/asm/processor.h | 4 + arch/microblaze/lib/board.c | 3 + .../xilinx/microblaze-generic/microblaze-generic.c | 4 + doc/README.watchdog | 3 + drivers/watchdog/Makefile | 1 + drivers/watchdog/xilinx_tb_wdt.c | 86 ++++++++++++++++++++++ include/configs/microblaze-generic.h | 8 ++ 7 files changed, 109 insertions(+) create mode 100644 drivers/watchdog/xilinx_tb_wdt.c
arch/microblaze/include/asm/processor.h +4 -0
@@ -31,4 +31,8 @@ extern char __text_start[];/* Microblaze board initialization function */ void board_init (void ); +/* Watchdog functions */ +int hw_watchdog_init (void ); +void hw_watchdog_disable (void ); +#endif /* __ASM_MICROBLAZE_PROCESSOR_H */
arch/microblaze/lib/board.c +3 -0
@@ -61,6 +61,9 @@ init_fnc_t *init_sequence[] = { serial_init, console_init_f, interrupts_init, +#ifdef CONFIG_XILINX_TB_WATCHDOG + hw_watchdog_init, +#endif timer_init, NULL, };
board/xilinx/microblaze-generic/microblaze-generic.c +4 -0
@@ -39,6 +39,10 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ++(*((unsigned long *)(CONFIG_SYS_GPIO_0_ADDR )));#endif +#ifdef CONFIG_XILINX_TB_WATCHDOG +hw_watchdog_disable (); +#endif +puts ("Reseting board\n" ); __asm__ __volatile__ (" mts rmsr, r0;" \"bra r0" );
doc/README.watchdog +3 -0
@@ -27,3 +27,6 @@ CONFIG_IMX_WATCHDOG Available for i.mx31/35/5x/6x to service the watchdog. This is not automatically set because some boards (vision2) still need to define their own hw_watchdog_reset routine. + +CONFIG_XILINX_TB_WATCHDOG + Available for Xilinx Axi platforms to service timebase watchdog timer.
drivers/watchdog/Makefile +1 -0
@@ -32,6 +32,7 @@ COBJS-y += imx_watchdog.o endif COBJS-$(CONFIG_TNETV107X_WATCHDOG) += tnetv107x_wdt.o COBJS-$(CONFIG_S5P) += s5p_wdt.o +COBJS-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c)
drivers/watchdog/xilinx_tb_wdt.c new file +86 -0
86 lines not on this page · raw message
include/configs/microblaze-generic.h +8 -0
@@ -120,6 +120,14 @@# define CONFIG_SYS_TIMER_0_IRQ XILINX_TIMER_IRQ#endif +/* watchdog */ +#if defined(XILINX_WATCHDOG_BASEADDR ) && defined(XILINX_WATCHDOG_IRQ ) +# define CONFIG_WATCHDOG_BASEADDR XILINX_WATCHDOG_BASEADDR +# define CONFIG_WATCHDOG_IRQ XILINX_WATCHDOG_IRQ +# define CONFIG_HW_WATCHDOG 1 +# define CONFIG_XILINX_TB_WATCHDOG 1 +#endif +/* * memory layout - Example * CONFIG_SYS_TEXT_BASE = 0x1200_0000; defined in config.mk
--
1.8.2.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130422/be549c7b/attachment.pgp>
PATCH 4/4 watchdog: Add support for Xilinx Microblaze watchdog
Quoted 1 line · Michal Simek
Watchdog can be used on Microblaze, PPC and Zynq hw designs.
[snip]
Quoted 1 line
+++
b/drivers/watchdog/xilinx_tb_wdt.c
[snip]
Quoted 1 line
+#define
watchdog_base((structwatchdog_regs*)CONFIG_WATCHDOG_BASEADDR)
Just do:
static struct watchdog_regs *watchdog_base = CONFIG_WATCHDOG_BASEADDR;
[snip]
include/configs/microblaze-generic.h line 128
Quoted 6 lines
include/configs/microblaze-generic.h +6
-0+/* watchdog */ +#if defined(XILINX_WATCHDOG_BASEADDR ) && defined(XILINX_WATCHDOG_IRQ ) +# define CONFIG_WATCHDOG_BASEADDR XILINX_WATCHDOG_BASEADDR +# define CONFIG_WATCHDOG_IRQ XILINX_WATCHDOG_IRQ +# define CONFIG_HW_WATCHDOG 1 +# define CONFIG_XILINX_TB_WATCHDOG 1
Just '#define' and no 1 for options that we only need to set please, thanks.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130422/cbed4af2/attachment.pgp>