From 83d1b3876695c4f21faff2b731d9ef83f38ed208 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sun, 17 Feb 2008 23:03:36 +0100 Subject: mpc86xx: Fix implicit declaration of functions 'init_laws' and 'disable_law' Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- cpu/mpc86xx/cpu_init.c | 1 + 1 file changed, 1 insertion(+) (limited to 'cpu') diff --git a/cpu/mpc86xx/cpu_init.c b/cpu/mpc86xx/cpu_init.c index ab5906dbc0..0efd855a39 100644 --- a/cpu/mpc86xx/cpu_init.c +++ b/cpu/mpc86xx/cpu_init.c @@ -28,6 +28,7 @@ #include #include +#include DECLARE_GLOBAL_DATA_PTR; -- cgit v1.2.1 From 04efddc87c50c84f85dad5c331c634a6ce830a83 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sun, 17 Feb 2008 23:35:31 +0100 Subject: mpc86xx: Fix unused variable 'config' and 'immap' and remove useless CONFIG_DDR_INTERLEAVE Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- cpu/mpc86xx/spd_sdram.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'cpu') diff --git a/cpu/mpc86xx/spd_sdram.c b/cpu/mpc86xx/spd_sdram.c index e501caf457..60a7818989 100644 --- a/cpu/mpc86xx/spd_sdram.c +++ b/cpu/mpc86xx/spd_sdram.c @@ -943,7 +943,7 @@ unsigned int enable_ddr(unsigned int ddr_num) spd_eeprom_t spd1,spd2; volatile ccsr_ddr_t *ddr; unsigned sdram_cfg_1; - unsigned char sdram_type, mem_type, config, mod_attr; + unsigned char sdram_type, mem_type, mod_attr; unsigned char d_init; unsigned int no_dimm1=0, no_dimm2=0; @@ -1017,6 +1017,10 @@ unsigned int enable_ddr(unsigned int ddr_num) printf("No memory modules found for DDR controller %d!!\n", ddr_num); return 0; } else { + +#if defined(CONFIG_DDR_ECC) + unsigned char config; +#endif mem_type = no_dimm2 ? spd1.mem_type : spd2.mem_type; /* @@ -1122,8 +1126,8 @@ spd_sdram(void) int memsize_ddr1_dimm2 = 0; int memsize_ddr1 = 0; unsigned int law_size_ddr1; - volatile immap_t *immap = (immap_t *)CFG_IMMR; #ifdef CONFIG_DDR_INTERLEAVE + volatile immap_t *immap = (immap_t *)CFG_IMMR; volatile ccsr_ddr_t *ddr1 = &immap->im_ddr1; #endif @@ -1183,7 +1187,6 @@ spd_sdram(void) #endif debug("Interleaved memory size is 0x%08lx\n", memsize_total); -#ifdef CONFIG_DDR_INTERLEAVE #if (CFG_PAGE_INTERLEAVING == 1) printf("Page "); #elif (CFG_BANK_INTERLEAVING == 1) @@ -1192,7 +1195,6 @@ spd_sdram(void) printf("Super-bank "); #else printf("Cache-line "); -#endif #endif printf("Interleaved"); return memsize_total * 1024 * 1024; -- cgit v1.2.1 From 13f5433f700d4da9f6fdf2a4bb80310133a7c170 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Mon, 18 Feb 2008 14:01:56 -0600 Subject: 86xx: Convert sbc8641d to use libfdt. This is the proper fix for a missing closing brace in the function ft_cpu_setup() noticed by joe.hamman embeddedspecialties.com. The ft_cpu_setup() function in mpc8641hpcn.c should have been removed earlier as it was under the obsolete CONFIG_OF_FLAT_TREE, but was missed. Only, the sbc8641d was nominally still using it. It all got ripped out, and the funcality that was in ft_board_setup() was refactored to remove the CPU portions into the new file cpu/mpc86xx/fdt.c instead. Make sbc8641d use this now. Based loosely on an original patch from joe.hamman@embeddedspecialties.com Signed-off-by: Jon Loeliger --- cpu/mpc86xx/Makefile | 17 ++++++++++----- cpu/mpc86xx/cpu.c | 61 ---------------------------------------------------- cpu/mpc86xx/fdt.c | 35 ++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 66 deletions(-) create mode 100644 cpu/mpc86xx/fdt.c (limited to 'cpu') diff --git a/cpu/mpc86xx/Makefile b/cpu/mpc86xx/Makefile index 6d9300e22e..537f62a323 100644 --- a/cpu/mpc86xx/Makefile +++ b/cpu/mpc86xx/Makefile @@ -28,13 +28,20 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(CPU).a -START = start.o #resetvec.o +START = start.o SOBJS = cache.o -COBJS = traps.o cpu.o cpu_init.o speed.o interrupts.o \ - spd_sdram.o -SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) +COBJS-y += traps.o +COBJS-y += cpu.o +COBJS-y += cpu_init.o +COBJS-y += speed.o +COBJS-y += interrupts.o +COBJS-y += spd_sdram.o + +COBJS-$(CONFIG_OF_LIBFDT) += fdt.o + +SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS-y)) START := $(addprefix $(obj),$(START)) all: $(obj).depend $(START) $(LIB) diff --git a/cpu/mpc86xx/cpu.c b/cpu/mpc86xx/cpu.c index e1b3c52dcd..bf4e651aaf 100644 --- a/cpu/mpc86xx/cpu.c +++ b/cpu/mpc86xx/cpu.c @@ -29,9 +29,6 @@ #include #include -#if defined(CONFIG_OF_FLAT_TREE) -#include -#endif int checkcpu(void) @@ -269,64 +266,6 @@ dma_xfer(void *dest, uint count, void *src) #endif /* CONFIG_DDR_ECC */ -#ifdef CONFIG_OF_FLAT_TREE -void -ft_cpu_setup(void *blob, bd_t *bd) -{ - u32 *p; - ulong clock; - int len; - - clock = bd->bi_busfreq; - p = ft_get_prop(blob, "/cpus/" OF_CPU "/bus-frequency", &len); - if (p != NULL) - *p = cpu_to_be32(clock); - - p = ft_get_prop(blob, "/" OF_SOC "/serial@4500/clock-frequency", &len); - if (p != NULL) - *p = cpu_to_be32(clock); - - p = ft_get_prop(blob, "/" OF_SOC "/serial@4600/clock-frequency", &len); - if (p != NULL) - *p = cpu_to_be32(clock); - -#if defined(CONFIG_TSEC1) - p = ft_get_prop(blob, "/" OF_SOC "/ethernet@24000/mac-address", &len); - if (p != NULL) - memcpy(p, bd->bi_enetaddr, 6); - p = ft_get_prop(blob, "/" OF_SOC "/ethernet@24000/local-mac-address", &len); - if (p) - memcpy(p, bd->bi_enetaddr, 6); -#endif - -#if defined(CONFIG_TSEC2) - p = ft_get_prop(blob, "/" OF_SOC "/ethernet@25000/mac-address", &len); - if (p != NULL) - memcpy(p, bd->bi_enet1addr, 6); - p = ft_get_prop(blob, "/" OF_SOC "/ethernet@25000/local-mac-address", &len); - if (p != NULL) - memcpy(p, bd->bi_enet1addr, 6); -#endif - -#if defined(CONFIG_TSEC3) - p = ft_get_prop(blob, "/" OF_SOC "/ethernet@26000/mac-address", &len); - if (p != NULL) - memcpy(p, bd->bi_enet2addr, 6); - p = ft_get_prop(blob, "/" OF_SOC "/ethernet@26000/local-mac-address", &len); - if (p != NULL) - memcpy(p, bd->bi_enet2addr, 6); -#endif - -#if defined(CONFIG_TSEC4) - p = ft_get_prop(blob, "/" OF_SOC "/ethernet@27000/mac-address", &len); - if (p != NULL) - memcpy(p, bd->bi_enet3addr, 6); - p = ft_get_prop(blob, "/" OF_SOC "/ethernet@27000/local-mac-address", &len); - if (p != NULL) - memcpy(p, bd->bi_enet3addr, 6); -#endif -#endif /* CONFIG_OF_FLAT_TREE */ - /* * Print out the state of various machine registers. * Currently prints out LAWs and BR0/OR0 diff --git a/cpu/mpc86xx/fdt.c b/cpu/mpc86xx/fdt.c new file mode 100644 index 0000000000..379306ea4f --- /dev/null +++ b/cpu/mpc86xx/fdt.c @@ -0,0 +1,35 @@ +/* + * Copyright 2008 Freescale Semiconductor, Inc. + * + * 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. + */ + +#include +#include +#include + +void ft_cpu_setup(void *blob, bd_t *bd) +{ + do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, + "timebase-frequency", bd->bi_busfreq / 4, 1); + do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, + "bus-frequency", bd->bi_busfreq, 1); + do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, + "clock-frequency", bd->bi_intfreq, 1); + do_fixup_by_prop_u32(blob, "device_type", "soc", 4, + "bus-frequency", bd->bi_busfreq, 1); + + fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); + +#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) \ + || defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3) + fdt_fixup_ethernet(blob, bd); +#endif + +#ifdef CFG_NS16550 + do_fixup_by_compat_u32(blob, "ns16550", + "clock-frequency", bd->bi_busfreq, 1); +#endif +} -- cgit v1.2.1 From c54f9263e4e11e34b1e70c160bc467ef1d8ec59d Mon Sep 17 00:00:00 2001 From: TsiChungLiew Date: Wed, 30 Jan 2008 15:04:42 -0600 Subject: ColdFire: Fix 5282 and 5271 interrupt mask bit Signed-off-by: TsiChung Liew --- cpu/mcf52x2/interrupts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cpu') diff --git a/cpu/mcf52x2/interrupts.c b/cpu/mcf52x2/interrupts.c index 2ccbde587e..9167cec698 100644 --- a/cpu/mcf52x2/interrupts.c +++ b/cpu/mcf52x2/interrupts.c @@ -77,7 +77,7 @@ void dtimer_intr_setup(void) volatile int0_t *intp = (int0_t *) (CFG_INTR_BASE); intp->icr0[CFG_TMRINTR_NO] = CFG_TMRINTR_PRI; - intp->imrl0 &= ~0xFFFFFFFE; + intp->imrl0 &= 0xFFFFFFFE; intp->imrl0 &= ~CFG_TMRINTR_MASK; } #endif /* CONFIG_MCFTMR */ -- cgit v1.2.1 From e682ba399a1d76f09d8cc7af1e57066f1d360d91 Mon Sep 17 00:00:00 2001 From: Shinya Kuribayashi Date: Sat, 23 Feb 2008 16:58:41 +0900 Subject: cpu/mips/cofigl.mk: Make a needlessly deffered expansion immediate. This reduces the build time by ~10%. Here's the gth2_config example. BEFORE AFTER real 0m31.441s 0m27.833s user 0m24.766s 0m23.045s sys 0m10.425s 0m7.468s Signed-off-by: Shinya Kuribayashi --- cpu/mips/config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cpu') diff --git a/cpu/mips/config.mk b/cpu/mips/config.mk index ad03bd61ba..b505a42550 100644 --- a/cpu/mips/config.mk +++ b/cpu/mips/config.mk @@ -21,7 +21,7 @@ # MA 02111-1307 USA # v=$(shell $(AS) --version |grep "GNU assembler" |cut -d. -f2) -MIPSFLAGS=$(shell \ +MIPSFLAGS:=$(shell \ if [ "$v" -lt "14" ]; then \ echo "-mcpu=4kc"; \ else \ -- cgit v1.2.1 From 495a0dde7fa1b14cdc15607d86503ec2bdcd02c4 Mon Sep 17 00:00:00 2001 From: Shinya Kuribayashi Date: Sat, 23 Feb 2008 17:05:00 +0900 Subject: cpu/ppc4xx/config.mk: Make a needlessly deffered expansion immediate. This will reduce the build time. Signed-off-by: Shinya Kuribayashi --- cpu/ppc4xx/config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cpu') diff --git a/cpu/ppc4xx/config.mk b/cpu/ppc4xx/config.mk index 311c97b732..baa97a4122 100644 --- a/cpu/ppc4xx/config.mk +++ b/cpu/ppc4xx/config.mk @@ -25,7 +25,7 @@ PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi -fno-strict-aliasing PLATFORM_CPPFLAGS += -DCONFIG_4xx -ffixed-r2 -mstring -msoft-float cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/') -is440=$(shell grep CONFIG_440 $(TOPDIR)/include/$(cfg)) +is440:=$(shell grep CONFIG_440 $(TOPDIR)/include/$(cfg)) ifneq (,$(findstring CONFIG_440,$(is440))) PLATFORM_CPPFLAGS += -Wa,-m440 -mcpu=440 -- cgit v1.2.1 From 208acd112e6517b21fc30c420396902b103563ac Mon Sep 17 00:00:00 2001 From: Shinya Kuribayashi Date: Sat, 23 Feb 2008 17:07:57 +0900 Subject: cpu/mcf52x2/config.mk: Make needlessly deffered expansions immediate. This will reduce the build time. Signed-off-by: Shinya Kuribayashi --- cpu/mcf52x2/config.mk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cpu') diff --git a/cpu/mcf52x2/config.mk b/cpu/mcf52x2/config.mk index f97157d041..c3899c507e 100644 --- a/cpu/mcf52x2/config.mk +++ b/cpu/mcf52x2/config.mk @@ -26,11 +26,11 @@ PLATFORM_RELFLAGS += -ffixed-d7 -msep-data cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/') -is5249=$(shell grep CONFIG_M5249 $(TOPDIR)/include/$(cfg)) -is5253=$(shell grep CONFIG_M5253 $(TOPDIR)/include/$(cfg)) -is5271=$(shell grep CONFIG_M5271 $(TOPDIR)/include/$(cfg)) -is5272=$(shell grep CONFIG_M5272 $(TOPDIR)/include/$(cfg)) -is5282=$(shell grep CONFIG_M5282 $(TOPDIR)/include/$(cfg)) +is5249:=$(shell grep CONFIG_M5249 $(TOPDIR)/include/$(cfg)) +is5253:=$(shell grep CONFIG_M5253 $(TOPDIR)/include/$(cfg)) +is5271:=$(shell grep CONFIG_M5271 $(TOPDIR)/include/$(cfg)) +is5272:=$(shell grep CONFIG_M5272 $(TOPDIR)/include/$(cfg)) +is5282:=$(shell grep CONFIG_M5282 $(TOPDIR)/include/$(cfg)) ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2) -- cgit v1.2.1 From b29661fc1151077776454288051bc9a488351ce8 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Sun, 24 Feb 2008 15:21:36 +0100 Subject: Coding style cleanup. Prepare v1.3.2-rc2 release candidate Signed-off-by: Wolfgang Denk --- cpu/arm926ejs/davinci/timer.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'cpu') diff --git a/cpu/arm926ejs/davinci/timer.c b/cpu/arm926ejs/davinci/timer.c index 4a1a54dcf1..8bb8b45713 100644 --- a/cpu/arm926ejs/davinci/timer.c +++ b/cpu/arm926ejs/davinci/timer.c @@ -61,10 +61,12 @@ davinci_timer *timer = (davinci_timer *)CFG_TIMERBASE; #define TIMER_LOAD_VAL (CFG_HZ_CLOCK / CFG_HZ) #define READ_TIMER timer->tim34 -/* Timer runs with CFG_HZ_CLOCK, currently 27MHz. To avoid wrap - around of timestamp already after min ~159s, divide it, e.g. by 16. - timestamp will then wrap around all min ~42min */ -#define DIV(x) ((x) >> 4) +/* + * Timer runs with CFG_HZ_CLOCK, currently 27MHz. To avoid wrap + * around of timestamp already after min ~159s, divide it, e.g. by 16. + * timestamp will then wrap around all min ~42min + */ +#define DIV(x) ((x) >> 4) static ulong timestamp; static ulong lastinc; @@ -106,20 +108,20 @@ void udelay(unsigned long usec) void reset_timer_masked(void) { - lastinc = DIV(READ_TIMER); + lastinc = DIV(READ_TIMER); timestamp = 0; } ulong get_timer_raw(void) { - ulong now = DIV(READ_TIMER); + ulong now = DIV(READ_TIMER); if (now >= lastinc) { /* normal mode */ timestamp += now - lastinc; } else { /* overflow ... */ - timestamp += now + DIV(TIMER_LOAD_VAL) - lastinc; + timestamp += now + DIV(TIMER_LOAD_VAL) - lastinc; } lastinc = now; return timestamp; @@ -127,7 +129,7 @@ ulong get_timer_raw(void) ulong get_timer_masked(void) { - return(get_timer_raw() / DIV(TIMER_LOAD_VAL)); + return(get_timer_raw() / DIV(TIMER_LOAD_VAL)); } void udelay_masked(unsigned long usec) -- cgit v1.2.1