From a509a1d40264516821d0ba2d1d6a6ab2e1a2acbd Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Tue, 26 Jan 2016 11:57:03 -0600 Subject: net: gem: Allow to set the MAC from an EEPROM Provide board specific option how to read MAC address from ROM. Do it in generic way to be reusable by differnet boards. If this is not enough board specific functions can be created. Signed-off-by: Joe Hershberger # driver part Signed-off-by: Michal Simek Signed-off-by: Michal Simek --- arch/arm/mach-zynq/include/mach/sys_proto.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch') diff --git a/arch/arm/mach-zynq/include/mach/sys_proto.h b/arch/arm/mach-zynq/include/mach/sys_proto.h index 882beab..44c9b50 100644 --- a/arch/arm/mach-zynq/include/mach/sys_proto.h +++ b/arch/arm/mach-zynq/include/mach/sys_proto.h @@ -19,6 +19,8 @@ extern int zynq_slcr_get_mio_pin_status(const char *periph); extern void zynq_ddrc_init(void); extern unsigned int zynq_get_silicon_version(void); +int zynq_board_read_rom_ethaddr(unsigned char *ethaddr); + /* Driver extern functions */ extern void ps7_init(void); -- cgit v1.1 From 9aa65cab73e4873f3e94c6df3d0efd99f3bc9926 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 15 Feb 2016 12:10:32 +0100 Subject: microblaze: Read information about timer/interrupts from DT Read information about timer and interrupts from DT. This is the first small step to move timer and intc to DM. Signed-off-by: Michal Simek --- arch/microblaze/cpu/interrupts.c | 25 +++++++++++++++++++++++++ arch/microblaze/cpu/timer.c | 39 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 63 insertions(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/microblaze/cpu/interrupts.c b/arch/microblaze/cpu/interrupts.c index b6d6610..e5d8894 100644 --- a/arch/microblaze/cpu/interrupts.c +++ b/arch/microblaze/cpu/interrupts.c @@ -10,10 +10,13 @@ #include #include +#include #include #include #include +DECLARE_GLOBAL_DATA_PTR; + void enable_interrupts(void) { debug("Enable interrupts for the whole CPU\n"); @@ -113,10 +116,32 @@ int interrupt_init(void) { int i; +#ifdef CONFIG_OF_CONTROL + const void *blob = gd->fdt_blob; + int node = 0; + + debug("INTC: Initialization\n"); + + node = fdt_node_offset_by_compatible(blob, node, + "xlnx,xps-intc-1.00.a"); + if (node != -1) { + fdt_addr_t base = fdtdec_get_addr(blob, node, "reg"); + if (base == FDT_ADDR_T_NONE) + return -1; + + debug("INTC: Base addr %lx\n", base); + intc = (microblaze_intc_t *)base; + irq_no = fdtdec_get_int(blob, node, "xlnx,num-intr-inputs", 0); + debug("INTC: IRQ NO %x\n", irq_no); + } else { + return node; + } +#else #if defined(CONFIG_SYS_INTC_0_ADDR) && defined(CONFIG_SYS_INTC_0_NUM) intc = (microblaze_intc_t *)CONFIG_SYS_INTC_0_ADDR; irq_no = CONFIG_SYS_INTC_0_NUM; #endif +#endif if (irq_no) { vecs = calloc(1, sizeof(struct irq_action) * irq_no); if (vecs == NULL) { diff --git a/arch/microblaze/cpu/timer.c b/arch/microblaze/cpu/timer.c index 3960bbb..c0fc7c0 100644 --- a/arch/microblaze/cpu/timer.c +++ b/arch/microblaze/cpu/timer.c @@ -7,9 +7,12 @@ */ #include +#include #include #include +DECLARE_GLOBAL_DATA_PTR; + volatile int timestamp = 0; microblaze_timer_t *tmr; @@ -29,8 +32,10 @@ void __udelay(unsigned long usec) while ((get_timer(0) - i) < (usec / 1000)) ; } else { +#ifndef CONFIG_OF_CONTROL for (i = 0; i < (usec * XILINX_CLOCK_FREQ / 10000000); i++) ; +#endif } } @@ -47,12 +52,44 @@ int timer_init (void) u32 preload = 0; u32 ret = 0; +#ifdef CONFIG_OF_CONTROL + const void *blob = gd->fdt_blob; + int node = 0; + u32 cell[2]; + + debug("TIMER: Initialization\n"); + + node = fdt_node_offset_by_compatible(blob, node, + "xlnx,xps-timer-1.00.a"); + if (node != -1) { + fdt_addr_t base = fdtdec_get_addr(blob, node, "reg"); + if (base == FDT_ADDR_T_NONE) + return -1; + + debug("TIMER: Base addr %lx\n", base); + tmr = (microblaze_timer_t *)base; + + ret = fdtdec_get_int_array(blob, node, "interrupts", + cell, ARRAY_SIZE(cell)); + if (ret) + return ret; + + irq = cell[0]; + debug("TIMER: IRQ %x\n", irq); + + preload = fdtdec_get_int(blob, node, "clock-frequency", 0); + preload /= CONFIG_SYS_HZ; + } else { + return node; + } + +#else #if defined(CONFIG_SYS_TIMER_0_ADDR) && defined(CONFIG_SYS_INTC_0_NUM) preload = XILINX_CLOCK_FREQ / CONFIG_SYS_HZ; irq = CONFIG_SYS_TIMER_0_IRQ; tmr = (microblaze_timer_t *) (CONFIG_SYS_TIMER_0_ADDR); #endif - +#endif if (tmr && preload && irq >= 0) { tmr->loadreg = preload; tmr->control = TIMER_INTERRUPT | TIMER_RESET; -- cgit v1.1 From a359eaa59857079678a2fa5ff0e4c0894de4ee1d Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 15 Feb 2016 13:44:19 +0100 Subject: microblaze: Remove !OF_CONTROL code for timer and interrupt OF_CONTROL is enabled by default that's why this is dead code. Signed-off-by: Michal Simek --- arch/microblaze/cpu/interrupts.c | 9 +-------- arch/microblaze/cpu/timer.c | 14 -------------- 2 files changed, 1 insertion(+), 22 deletions(-) (limited to 'arch') diff --git a/arch/microblaze/cpu/interrupts.c b/arch/microblaze/cpu/interrupts.c index e5d8894..010ca4a 100644 --- a/arch/microblaze/cpu/interrupts.c +++ b/arch/microblaze/cpu/interrupts.c @@ -115,8 +115,6 @@ static void intc_init(void) int interrupt_init(void) { int i; - -#ifdef CONFIG_OF_CONTROL const void *blob = gd->fdt_blob; int node = 0; @@ -136,12 +134,7 @@ int interrupt_init(void) } else { return node; } -#else -#if defined(CONFIG_SYS_INTC_0_ADDR) && defined(CONFIG_SYS_INTC_0_NUM) - intc = (microblaze_intc_t *)CONFIG_SYS_INTC_0_ADDR; - irq_no = CONFIG_SYS_INTC_0_NUM; -#endif -#endif + if (irq_no) { vecs = calloc(1, sizeof(struct irq_action) * irq_no); if (vecs == NULL) { diff --git a/arch/microblaze/cpu/timer.c b/arch/microblaze/cpu/timer.c index c0fc7c0..8845e07 100644 --- a/arch/microblaze/cpu/timer.c +++ b/arch/microblaze/cpu/timer.c @@ -31,11 +31,6 @@ void __udelay(unsigned long usec) i = get_timer(0); while ((get_timer(0) - i) < (usec / 1000)) ; - } else { -#ifndef CONFIG_OF_CONTROL - for (i = 0; i < (usec * XILINX_CLOCK_FREQ / 10000000); i++) - ; -#endif } } @@ -51,8 +46,6 @@ int timer_init (void) int irq = -1; u32 preload = 0; u32 ret = 0; - -#ifdef CONFIG_OF_CONTROL const void *blob = gd->fdt_blob; int node = 0; u32 cell[2]; @@ -83,13 +76,6 @@ int timer_init (void) return node; } -#else -#if defined(CONFIG_SYS_TIMER_0_ADDR) && defined(CONFIG_SYS_INTC_0_NUM) - preload = XILINX_CLOCK_FREQ / CONFIG_SYS_HZ; - irq = CONFIG_SYS_TIMER_0_IRQ; - tmr = (microblaze_timer_t *) (CONFIG_SYS_TIMER_0_ADDR); -#endif -#endif if (tmr && preload && irq >= 0) { tmr->loadreg = preload; tmr->control = TIMER_INTERRUPT | TIMER_RESET; -- cgit v1.1 From a1108da7318cb0dee90e899309cb4e5e90f9d690 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 18 Mar 2016 18:21:36 +0100 Subject: ARM64: zynqmp: Select SYS_CONFIG_NAME via Kconfig This option enable adding new platform suport just by adding defconfig and DTS file which will target generic configuration for SoC. Make no sense to extend Kconfig just create a pointer between DTS and configuration file. Signed-off-by: Michal Simek --- arch/arm/cpu/armv8/zynqmp/Kconfig | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'arch') diff --git a/arch/arm/cpu/armv8/zynqmp/Kconfig b/arch/arm/cpu/armv8/zynqmp/Kconfig index 9a19dfa..6c71d78 100644 --- a/arch/arm/cpu/armv8/zynqmp/Kconfig +++ b/arch/arm/cpu/armv8/zynqmp/Kconfig @@ -1,13 +1,5 @@ if ARCH_ZYNQMP -choice - prompt "Xilinx ZynqMP board select" - -config TARGET_ZYNQMP_EP - bool "ZynqMP EP Board" - -endchoice - config SYS_BOARD default "zynqmp" @@ -18,7 +10,12 @@ config SYS_SOC default "zynqmp" config SYS_CONFIG_NAME - default "xilinx_zynqmp_ep" if TARGET_ZYNQMP_EP + string "Board configuration name" + default "xilinx_zynqmp" + help + This option contains information about board configuration name. + Based on this option include/configs/.h header + will be used for board configuration. config ZYNQMP_USB bool "Configure ZynqMP USB" -- cgit v1.1