From b6c180928c3c7c9efbdc5eb1b468c450c877abdf Mon Sep 17 00:00:00 2001 From: Thomas Chou Date: Fri, 4 Sep 2015 16:19:16 +0800 Subject: nios2: move altera_pio_init to board_early_init_r As altera_pio_init() uses BSS, it should be moved to board_early_init_r(). Signed-off-by: Thomas Chou Acked-by: Marek Vasut --- board/altera/nios2-generic/nios2-generic.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'board/altera/nios2-generic') diff --git a/board/altera/nios2-generic/nios2-generic.c b/board/altera/nios2-generic/nios2-generic.c index 834cbeb2d5..384fee9b75 100644 --- a/board/altera/nios2-generic/nios2-generic.c +++ b/board/altera/nios2-generic/nios2-generic.c @@ -28,16 +28,21 @@ void early_flash_cmd_reset(void) int board_early_init_f(void) { +#if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR) && \ + defined(CONFIG_CFI_FLASH_MTD) + early_flash_cmd_reset(); +#endif + return 0; +} + +int board_early_init_r(void) +{ #ifdef CONFIG_ALTERA_PIO #ifdef LED_PIO_BASE altera_pio_init(LED_PIO_BASE, LED_PIO_WIDTH, 'o', LED_PIO_RSTVAL, (1 << LED_PIO_WIDTH) - 1, "led"); #endif -#endif -#if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR) && \ - defined(CONFIG_CFI_FLASH_MTD) - early_flash_cmd_reset(); #endif return 0; } -- cgit From 88d5ecf4b9c0d5a3bff5d6d98ab7383a550a57db Mon Sep 17 00:00:00 2001 From: Thomas Chou Date: Wed, 21 Oct 2015 21:33:45 +0800 Subject: nios2 : convert altera_pio to driver model Convert altera_pio to driver model. Signed-off-by: Thomas Chou Acked-by: Chin Liang See Reviewed-by: Simon Glass --- board/altera/nios2-generic/nios2-generic.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'board/altera/nios2-generic') diff --git a/board/altera/nios2-generic/nios2-generic.c b/board/altera/nios2-generic/nios2-generic.c index 384fee9b75..cb98a08895 100644 --- a/board/altera/nios2-generic/nios2-generic.c +++ b/board/altera/nios2-generic/nios2-generic.c @@ -35,18 +35,6 @@ int board_early_init_f(void) return 0; } -int board_early_init_r(void) -{ -#ifdef CONFIG_ALTERA_PIO -#ifdef LED_PIO_BASE - altera_pio_init(LED_PIO_BASE, LED_PIO_WIDTH, 'o', - LED_PIO_RSTVAL, (1 << LED_PIO_WIDTH) - 1, - "led"); -#endif -#endif - return 0; -} - int checkboard(void) { printf("BOARD : %s\n", CONFIG_BOARD_NAME); -- cgit From ca844dd8c55f3b7bbba8144b0dcbf1297fcaece0 Mon Sep 17 00:00:00 2001 From: Thomas Chou Date: Wed, 14 Oct 2015 08:43:31 +0800 Subject: nios2: convert altera sysid to driver model Convert altera sysid to driver model with misc uclass. Signed-off-by: Thomas Chou Acked-by: Chin Liang See Reviewed-by: Simon Glass --- board/altera/nios2-generic/nios2-generic.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'board/altera/nios2-generic') diff --git a/board/altera/nios2-generic/nios2-generic.c b/board/altera/nios2-generic/nios2-generic.c index cb98a08895..1f10821113 100644 --- a/board/altera/nios2-generic/nios2-generic.c +++ b/board/altera/nios2-generic/nios2-generic.c @@ -37,7 +37,10 @@ int board_early_init_f(void) int checkboard(void) { - printf("BOARD : %s\n", CONFIG_BOARD_NAME); +#ifdef CONFIG_ALTERA_SYSID + display_sysid(); +#endif + printf("BOARD: %s\n", CONFIG_BOARD_NAME); return 0; } -- cgit From bbba0714b7ca2d2424c11193a7884da8ef05c520 Mon Sep 17 00:00:00 2001 From: Thomas Chou Date: Fri, 9 Oct 2015 11:36:01 +0800 Subject: nios2: zap initdram Zap initdram(), as it is not used. Signed-off-by: Thomas Chou Acked-by: Marek Vasut --- board/altera/nios2-generic/nios2-generic.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'board/altera/nios2-generic') diff --git a/board/altera/nios2-generic/nios2-generic.c b/board/altera/nios2-generic/nios2-generic.c index 1f10821113..e7fecd24e4 100644 --- a/board/altera/nios2-generic/nios2-generic.c +++ b/board/altera/nios2-generic/nios2-generic.c @@ -44,11 +44,6 @@ int checkboard(void) return 0; } -phys_size_t initdram(int board_type) -{ - return 0; -} - #ifdef CONFIG_CMD_NET int board_eth_init(bd_t *bis) { -- cgit From 6168dc6a7a28da3e865314bf1ba5a53eaebe63ac Mon Sep 17 00:00:00 2001 From: Thomas Chou Date: Fri, 23 Oct 2015 14:55:36 +0800 Subject: nios2: zap nios2-generic board dir As we use device tree to control u-boot now, the generic board can be removed. Signed-off-by: Thomas Chou --- board/altera/nios2-generic/Kconfig | 12 ---- board/altera/nios2-generic/MAINTAINERS | 6 -- board/altera/nios2-generic/Makefile | 10 ---- board/altera/nios2-generic/config.mk | 12 ---- board/altera/nios2-generic/custom_fpga.h | 89 ------------------------------ board/altera/nios2-generic/nios2-generic.c | 76 ------------------------- 6 files changed, 205 deletions(-) delete mode 100644 board/altera/nios2-generic/Kconfig delete mode 100644 board/altera/nios2-generic/MAINTAINERS delete mode 100644 board/altera/nios2-generic/Makefile delete mode 100644 board/altera/nios2-generic/config.mk delete mode 100644 board/altera/nios2-generic/custom_fpga.h delete mode 100644 board/altera/nios2-generic/nios2-generic.c (limited to 'board/altera/nios2-generic') diff --git a/board/altera/nios2-generic/Kconfig b/board/altera/nios2-generic/Kconfig deleted file mode 100644 index cd3d0980a7..0000000000 --- a/board/altera/nios2-generic/Kconfig +++ /dev/null @@ -1,12 +0,0 @@ -if TARGET_NIOS2_GENERIC - -config SYS_BOARD - default "nios2-generic" - -config SYS_VENDOR - default "altera" - -config SYS_CONFIG_NAME - default "nios2-generic" - -endif diff --git a/board/altera/nios2-generic/MAINTAINERS b/board/altera/nios2-generic/MAINTAINERS deleted file mode 100644 index 9cbcba983b..0000000000 --- a/board/altera/nios2-generic/MAINTAINERS +++ /dev/null @@ -1,6 +0,0 @@ -NIOS2-GENERIC BOARD -M: Scott McNutt -S: Maintained -F: board/altera/nios2-generic/ -F: include/configs/nios2-generic.h -F: configs/nios2-generic_defconfig diff --git a/board/altera/nios2-generic/Makefile b/board/altera/nios2-generic/Makefile deleted file mode 100644 index 5e4192c1e7..0000000000 --- a/board/altera/nios2-generic/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# -# (C) Copyright 2001-2006 -# Wolfgang Denk, DENX Software Engineering, wd@denx.de. -# (C) Copyright 2010, Thomas Chou -# -# SPDX-License-Identifier: GPL-2.0+ -# - -obj-y := nios2-generic.o -obj-$(CONFIG_CMD_IDE) += ../common/cfide.o diff --git a/board/altera/nios2-generic/config.mk b/board/altera/nios2-generic/config.mk deleted file mode 100644 index a673525195..0000000000 --- a/board/altera/nios2-generic/config.mk +++ /dev/null @@ -1,12 +0,0 @@ -# -# (C) Copyright 2005, Psyent Corporation -# Scott McNutt -# -# SPDX-License-Identifier: GPL-2.0+ -# - -PLATFORM_CPPFLAGS += -mno-hw-div -mno-hw-mul - -ifeq ($(debug),1) -PLATFORM_CPPFLAGS += -DDEBUG -endif diff --git a/board/altera/nios2-generic/custom_fpga.h b/board/altera/nios2-generic/custom_fpga.h deleted file mode 100644 index cf75d35648..0000000000 --- a/board/altera/nios2-generic/custom_fpga.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * This header is generated by sopc2dts - * Sopc2dts is written by Walter Goossens - * in cooperation with the nios2 community - * - * SPDX-License-Identifier: GPL-2.0+ - */ -#ifndef _CUSTOM_FPGA_H_ -#define _CUSTOM_FPGA_H_ - -/* generated from qsys_ghrd_3c120.sopcinfo */ - -/* Dumping slaves of cpu.data_master */ - -/* cpu.jtag_debug_module is a altera_nios2_qsys */ -#define CONFIG_SYS_CLK_FREQ 125000000 -#define CONFIG_SYS_DCACHE_SIZE 32768 -#define CONFIG_SYS_DCACHELINE_SIZE 32 -#define CONFIG_SYS_ICACHELINE_SIZE 32 -#define CONFIG_SYS_EXCEPTION_ADDR 0xd0000020 -#define CONFIG_SYS_ICACHE_SIZE 32768 -#define CONFIG_SYS_RESET_ADDR 0xc2800000 -#define IO_REGION_BASE 0xE0000000 - -/* pb_cpu_to_ddr2_bot.s0 is a altera_avalon_mm_bridge */ -/* Dumping slaves of pb_cpu_to_ddr2_bot.m0 */ - -/* ddr2_bot.s1 is a altmemddr2 */ -#define CONFIG_SYS_SDRAM_BASE 0xD0000000 -#define CONFIG_SYS_SDRAM_SIZE 0x08000000 - -/* pb_cpu_to_io.s0 is a altera_avalon_mm_bridge */ -/* Dumping slaves of pb_cpu_to_io.m0 */ - -/* timer_1ms.s1 is a altera_avalon_timer */ -#define CONFIG_SYS_TIMER_IRQ 11 -#define CONFIG_SYS_TIMER_FREQ 125000000 -#define CONFIG_SYS_TIMER_BASE 0xE8400000 - -/* sysid.control_slave is a altera_avalon_sysid_qsys */ -#define CONFIG_SYS_SYSID_BASE 0xE8004D40 - -/* jtag_uart.avalon_jtag_slave is a altera_avalon_jtag_uart */ -#define CONFIG_SYS_JTAG_UART_BASE 0xE8004D50 - -/* tse_mac.control_port is a triple_speed_ethernet */ -#define CONFIG_SYS_ALTERA_TSE_RX_FIFO 2048 -#define CONFIG_SYS_ALTERA_TSE_SGDMA_TX_BASE 0xE8004800 -#define CONFIG_SYS_ALTERA_TSE_SGDMA_RX_BASE 0xE8004400 -#define CONFIG_SYS_ALTERA_TSE_TX_FIFO 2048 -#define CONFIG_SYS_ALTERA_TSE_DESC_SIZE 0x00002000 -#define CONFIG_SYS_ALTERA_TSE_MAC_BASE 0xE8004000 -#define CONFIG_SYS_ALTERA_TSE_DESC_BASE 0xE8002000 -#define CONFIG_ALTERA_TSE -#define CONFIG_MII -#define CONFIG_CMD_MII -#define CONFIG_SYS_ALTERA_TSE_PHY_ADDR 18 -#define CONFIG_SYS_ALTERA_TSE_FLAGS 1 - -/* uart.s1 is a altera_avalon_uart */ -#define CONFIG_SYS_UART_BAUD 115200 -#define CONFIG_SYS_UART_BASE 0xE8004C80 -#define CONFIG_SYS_UART_FREQ 62500000 - -/* user_led_pio_8out.s1 is a altera_avalon_pio */ -#define USER_LED_PIO_8OUT_BASE 0xE8004CC0 - -/* user_dipsw_pio_8in.s1 is a altera_avalon_pio */ -#define USER_DIPSW_PIO_8IN_BASE 0xE8004CE0 -#define USER_DIPSW_PIO_8IN_IRQ 8 - -/* user_pb_pio_4in.s1 is a altera_avalon_pio */ -#define USER_PB_PIO_4IN_BASE 0xE8004D00 -#define USER_PB_PIO_4IN_IRQ 9 - -/* cfi_flash_64m.uas is a altera_generic_tristate_controller */ -#define CFI_FLASH_64M_BASE 0xE0000000 - -/* ext_flash.s1 is a altera_avalon_cfi_flash */ -#define CONFIG_SYS_FLASH_BASE CFI_FLASH_64M_BASE -#define CONFIG_FLASH_CFI_DRIVER -#define CONFIG_SYS_CFI_FLASH_STATUS_POLL /* fix amd flash issue */ -#define CONFIG_SYS_FLASH_CFI -#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE -#define CONFIG_SYS_FLASH_PROTECTION -#define CONFIG_SYS_MAX_FLASH_BANKS 1 -#define CONFIG_SYS_MAX_FLASH_SECT 512 - -#endif /* _CUSTOM_FPGA_H_ */ diff --git a/board/altera/nios2-generic/nios2-generic.c b/board/altera/nios2-generic/nios2-generic.c deleted file mode 100644 index e7fecd24e4..0000000000 --- a/board/altera/nios2-generic/nios2-generic.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * (C) Copyright 2005, Psyent Corporation - * Scott McNutt - * (C) Copyright 2010, Thomas Chou - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include -#if defined(CONFIG_CFI_FLASH_MTD) -#include -#endif -#include -#include - -#if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR) && \ - defined(CONFIG_CFI_FLASH_MTD) -static void __early_flash_cmd_reset(void) -{ - /* reset flash before we read env */ - writeb(AMD_CMD_RESET, CONFIG_ENV_ADDR); - writeb(FLASH_CMD_RESET, CONFIG_ENV_ADDR); -} -void early_flash_cmd_reset(void) - __attribute__((weak,alias("__early_flash_cmd_reset"))); -#endif - -int board_early_init_f(void) -{ -#if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR) && \ - defined(CONFIG_CFI_FLASH_MTD) - early_flash_cmd_reset(); -#endif - return 0; -} - -int checkboard(void) -{ -#ifdef CONFIG_ALTERA_SYSID - display_sysid(); -#endif - printf("BOARD: %s\n", CONFIG_BOARD_NAME); - return 0; -} - -#ifdef CONFIG_CMD_NET -int board_eth_init(bd_t *bis) -{ - int rc = 0; -#ifdef CONFIG_SMC91111 - rc += smc91111_initialize(0, CONFIG_SMC91111_BASE); -#endif -#ifdef CONFIG_DRIVER_DM9000 - rc += dm9000_initialize(bis); -#endif -#ifdef CONFIG_ALTERA_TSE - rc += altera_tse_initialize(0, - CONFIG_SYS_ALTERA_TSE_MAC_BASE, - CONFIG_SYS_ALTERA_TSE_SGDMA_RX_BASE, - CONFIG_SYS_ALTERA_TSE_SGDMA_TX_BASE, -#if defined(CONFIG_SYS_ALTERA_TSE_SGDMA_DESC_BASE) && \ - (CONFIG_SYS_ALTERA_TSE_SGDMA_DESC_SIZE > 0) - CONFIG_SYS_ALTERA_TSE_SGDMA_DESC_BASE, - CONFIG_SYS_ALTERA_TSE_SGDMA_DESC_SIZE); -#else - 0, - 0); -#endif -#endif -#ifdef CONFIG_ETHOC - rc += ethoc_initialize(0, CONFIG_SYS_ETHOC_BASE); -#endif - return rc; -} -#endif -- cgit