Add support for MB86R0x SoCs
Subsystems (3)
v5 cover Add support for MB86R0x SoCs
This patchset adds support for MB86R0x SoC familiy from Fujitsu, its built in lcd controller and a first board using the MB86R01.
Changes since V4
- Rebased to current master branch
Changes since V3
- Added support for additional oscillator frequency
Changes since V2
- Rebased to current u-boot next branch
Changes since V1
- Used C structs for addressing instead of base + offset
- Moved offsets for assmebler code to asm-offsets.h
- Moved some dublicated sections of code to functions
Matthias Weisser (3):
arm: Add support for MB86R0x SoCs
video: add support for display controller in MB86R0x SoCs
arm: Add support for jadecpu board based on MB86R01 SoC
MAINTAINERS | 4 + MAKEALL | 1 + arch/arm/cpu/arm926ejs/mb86r0x/Makefile | 47 ++ arch/arm/cpu/arm926ejs/mb86r0x/clock.c | 45 ++ arch/arm/cpu/arm926ejs/mb86r0x/reset.c | 40 ++ arch/arm/cpu/arm926ejs/mb86r0x/timer.c | 139 ++++++ arch/arm/include/asm/arch-mb86r0x/asm-offsets.h | 74 +++ arch/arm/include/asm/arch-mb86r0x/hardware.h | 31 ++ arch/arm/include/asm/arch-mb86r0x/mb86r0x.h | 573 +++++++++++++++++++++++ board/syteco/jadecpu/Makefile | 55 +++ board/syteco/jadecpu/config.mk | 1 + board/syteco/jadecpu/jadecpu.c | 170 +++++++ board/syteco/jadecpu/lowlevel_init.S | 265 +++++++++++ boards.cfg | 1 + common/serial.c | 6 +- drivers/video/Makefile | 1 + drivers/video/mb86r0xgdc.c | 186 ++++++++ include/configs/jadecpu.h | 294 ++++++++++++ include/serial.h | 6 +- tools/Makefile | 3 + tools/logos/syteco.bmp | Bin 0 -> 11414 bytes 21 files changed, 1936 insertions(+), 6 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/mb86r0x/Makefile create mode 100644 arch/arm/cpu/arm926ejs/mb86r0x/clock.c create mode 100644 arch/arm/cpu/arm926ejs/mb86r0x/reset.c create mode 100644 arch/arm/cpu/arm926ejs/mb86r0x/timer.c create mode 100644 arch/arm/include/asm/arch-mb86r0x/asm-offsets.h create mode 100644 arch/arm/include/asm/arch-mb86r0x/hardware.h create mode 100644 arch/arm/include/asm/arch-mb86r0x/mb86r0x.h create mode 100644 board/syteco/jadecpu/Makefile create mode 100644 board/syteco/jadecpu/config.mk create mode 100644 board/syteco/jadecpu/jadecpu.c create mode 100644 board/syteco/jadecpu/lowlevel_init.S create mode 100644 drivers/video/mb86r0xgdc.c create mode 100644 include/configs/jadecpu.h create mode 100644 tools/logos/syteco.bmp
PATCH v5 1/3 arm: Add support for MB86R0x SoCs
This patch adds support for MB86R0x SoCs from Fujitsu
--- arch/arm/cpu/arm926ejs/mb86r0x/Makefile | 47 ++ arch/arm/cpu/arm926ejs/mb86r0x/clock.c | 45 ++ arch/arm/cpu/arm926ejs/mb86r0x/reset.c | 40 ++ arch/arm/cpu/arm926ejs/mb86r0x/timer.c | 139 ++++++ arch/arm/include/asm/arch-mb86r0x/asm-offsets.h | 74 +++ arch/arm/include/asm/arch-mb86r0x/hardware.h | 31 ++ arch/arm/include/asm/arch-mb86r0x/mb86r0x.h | 573 +++++++++++++++++++++++ common/serial.c | 6 +- include/serial.h | 6 +- 9 files changed, 955 insertions(+), 6 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/mb86r0x/Makefile create mode 100644 arch/arm/cpu/arm926ejs/mb86r0x/clock.c create mode 100644 arch/arm/cpu/arm926ejs/mb86r0x/reset.c create mode 100644 arch/arm/cpu/arm926ejs/mb86r0x/timer.c create mode 100644 arch/arm/include/asm/arch-mb86r0x/asm-offsets.h create mode 100644 arch/arm/include/asm/arch-mb86r0x/hardware.h create mode 100644 arch/arm/include/asm/arch-mb86r0x/mb86r0x.h
arch/arm/cpu/arm926ejs/mb86r0x/Makefile new file +47 -0
@@ -0,0 +1,47 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd at 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 $(TOPDIR)/config.mk + +LIB = $(obj)lib$(SOC).a + +COBJS = clock.o reset.o timer.o +SOBJS = + +SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS)) +START := $(addprefix $(obj),$(START)) + +all: $(obj).depend $(LIB) + +$(LIB): $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
arch/arm/cpu/arm926ejs/mb86r0x/clock.c new file +45 -0
45 lines not on this page · raw message
arch/arm/cpu/arm926ejs/mb86r0x/reset.c new file +40 -0
@@ -0,0 +1,40 @@ +/* +* (C) Copyright 2010 +* Matthias Weisser <[email protected]> +* +* 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 <common.h> +#include <asm/io.h> +#include <asm/arch/hardware.h> + +/* +* Reset the cpu by setting software reset request bit +*/ +void reset_cpu (ulong ignored) +{ +struct mb86r0x_crg * crg = (struct mb86r0x_crg *) + MB86R0x_CRG_BASE; + +writel (MB86R0x_CRSR_SWRSTREQ, &crg->crsr); +while (1 ) +/* NOP */ ; +/* Never reached */ +}
arch/arm/cpu/arm926ejs/mb86r0x/timer.c new file +139 -0
139 lines not on this page · raw message
arch/arm/include/asm/arch-mb86r0x/asm-offsets.h new file +74 -0
74 lines not on this page · raw message
arch/arm/include/asm/arch-mb86r0x/hardware.h new file +31 -0
@@ -0,0 +1,31 @@ +/* +* (C) Copyright 2007 +* +* Author : Carsten Schneider, mycable GmbH +* <[email protected]> +* +* 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_ARCH_HARDWARE_H +#define __ASM_ARCH_HARDWARE_H + +#include <asm/sizes.h> +#include <asm/arch/mb86r0x.h> + +#endif
arch/arm/include/asm/arch-mb86r0x/mb86r0x.h new file +573 -0
573 lines not on this page · raw message
common/serial.c +3 -3
@@ -40,9 +40,9 @@ struct serial_device *__default_serial_console (void)return &serial_scc_device;#elif defined(CONFIG_405GP ) || defined(CONFIG_405CR ) || defined(CONFIG_440 ) \ || defined(CONFIG_405EP ) || defined(CONFIG_405EZ ) || defined(CONFIG_405EX ) \ - || defined(CONFIG_MPC5xxx) || defined(CONFIG_MPC83xx) \ - || defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) \ - || defined(CONFIG_SYS_SC520 ) + || defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) \ + || defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) \ + || defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520 )#if defined(CONFIG_CONS_INDEX ) && defined(CONFIG_SYS_NS16550_SERIAL )#if (CONFIG_CONS_INDEX ==1 )return &eserial1_device;
include/serial.h +3 -3
@@ -25,9 +25,9 @@ extern struct serial_device * default_serial_console (void);#if defined(CONFIG_405GP ) || defined(CONFIG_405CR ) || defined(CONFIG_440 ) || \ defined(CONFIG_405EP ) || defined(CONFIG_405EZ ) || defined(CONFIG_405EX ) || \ - defined(CONFIG_MPC5xxx) || defined(CONFIG_MPC83xx) || \ - defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) || \ - defined(CONFIG_SYS_SC520 ) + defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \ + defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \ + defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520 )extern struct serial_device serial0_device;extern struct serial_device serial1_device;#if defined(CONFIG_SYS_NS16550_SERIAL )
Signature · 1 line
1.7.0.4
PATCH v5 1/3 arm: Add support for MB86R0x SoCs
Dear Matthias Weisser,
Quoted 3 lines · In message <[email protected]> you wrote:
This patch adds support for MB86R0x SoCs from Fujitsu
Signed-off-by Matthias Weisser <[email protected]>
...
Quoted 2 lines
arch/arm/cpu/arm926ejs/mb86r0x/clock.c new file +0
-0
...
arch/arm/cpu/arm926ejs/mb86r0x/clock.c line 44
Quoted 6 lines
arch/arm/cpu/arm926ejs/mb86r0x/clock.c new file +6
-0+if (pllmode == MB86R0x_CRG_CRPR_PLLMODE_X46) +return 41164767 ; +else if (pllmode == MB86R0x_CRG_CRPR_PLLMODE_X20) +return 40000000 ; + +return 41164767 ;
Or shorter:
if (pllmode == MB86R0x_CRG_CRPR_PLLMODE_X20) return 40000000; return 41164767;
arch/arm/cpu/arm926ejs/mb86r0x/clock.c
Quoted 10 lines
arch/arm/cpu/arm926ejs/mb86r0x/clock.c new file +10
-0+unsigned long long get_ticks (void ) +{ +struct mb86r0x_timer * timer = (struct mb86r0x_timer *) + MB86R0x_TIMER_BASE; +ulong now =readl (&timer->value); + +if (now <= lastdec)/* normal mode (non roll) */ +/* move stamp forward with absolut diff ticks */ + timestamp += lastdec - now; +else /* we have rollover of incrementer */
We need curly braces for multiline statements like this.
arch/arm/cpu/arm926ejs/mb86r0x/clock.c
Quoted 10 lines
arch/arm/cpu/arm926ejs/mb86r0x/clock.c new file +10
-0+void __udelay (unsigned long usec) +{ +unsigned long long tmp; +ulong tmo; + + tmo =usec_to_tick (usec); + tmp =get_ticks () + tmo;/* get current timestamp */ + +while (get_ticks () < tmp)/* loop till event */ +/*NOP*/ ;
This is broken when the timer wraps around. Compare the limit against the difference, to make use of unsigned arithmetics.
Best regards,
Wolfgang Denk
Signature · 5 lines
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: wd at denx.de It seems intuitively obvious to me, which means that it might be wrong. -- Chris Torek
PATCH v5 1/3 arm: Add support for MB86R0x SoCs
Hello Wolfgang
Am 07.08.2010 23:35, schrieb Wolfgang Denk:
Quoted 16 lines
Dear Matthias Weisser,
arch/arm/cpu/arm926ejs/mb86r0x/timer.c line 116
Quoted 10 lines · In message<[email protected]> you wrote:
arch/arm/cpu/arm926ejs/mb86r0x/timer.c new file +10
-0+void __udelay (unsigned long usec) +{ +unsigned long long tmp; +ulong tmo; + + tmo =usec_to_tick (usec); + tmp =get_ticks () + tmo;/* get current timestamp */ + +while (get_ticks ()< tmp)/* loop till event */ +/*NOP*/ ;This is broken when the timer wraps around. Compare the limit against the difference, to make use of unsigned arithmetics.
Isn't this a theoretical problem? The timer increments with approx. 160kHz. get_ticks() returns a 64 bit value which wraps all ~ 3*10^6 years. I don't expect my hardware to work that long without a reboot.
Can you point me to an example where the timer stuff is done right? I see it done differently on nearly all ARM SOCs.
Thanks for the review
Matthias
PATCH v5 1/3 arm: Add support for MB86R0x SoCs
Dear =?ISO-8859-1?Q?Matthias_Wei=DFer?=,
Quoted 10 lines · In message <[email protected]> you wrote:
Quoted 9 lines
arch/arm/cpu/arm926ejs/mb86r0x/timer.c line 116
Quoted 6 lines
arch/arm/cpu/arm926ejs/mb86r0x/timer.c new file +5
-0+ tmo =usec_to_tick (usec); + tmp =get_ticks () + tmo;/* get current timestamp */ + +while (get_ticks ()< tmp)/* loop till event */ +/*NOP*/ ;This is broken when the timer wraps around. Compare the limit against the difference, to make use of unsigned arithmetics.
Quoted 3 lines
Isn't this a theoretical problem? The timer increments with approx. 160kHz.
get_ticks()returns a 64 bit value which wraps all ~ 3*10^6 years. I don't expect my hardware to work that long without a reboot.
Such assumptions that problems might remain theoretical have cuased enough real problems already. I mean, if it was difficult to write correct code I might turn a blind eye, but why not fix it? It's a trivial change...
Quoted 2 lines
Can you point me to an example where the timer stuff is done right? I see it done differently on nearly all ARM SOCs.
Rule of a thumb: to copy from ARM means copying problems.
Use:
while ((get_ticks() - tmp) < tmo) ;
Best regards,
Wolfgang Denk
Signature · 6 lines
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: [email protected] Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer. - Fred Brooks, Jr.
PATCH v5 2/3 video: add support for display controller in MB86R0x SoCs
In reply to Matthias WeisserThis patch adds support for the display controller in the MB86R0x SoCs.
--- drivers/video/Makefile | 1 + drivers/video/mb86r0xgdc.c | 186 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 187 insertions(+), 0 deletions(-) create mode 100644 drivers/video/mb86r0xgdc.c
drivers/video/Makefile +1 -0
@@ -32,6 +32,7 @@ COBJS-$(CONFIG_S6E63D6) += s6e63d6.o COBJS-$(CONFIG_VIDEO_AMBA) += amba.o COBJS-$(CONFIG_VIDEO_CT69000) += ct69000.o videomodes.o COBJS-$(CONFIG_VIDEO_MB862xx) += mb862xx.o videomodes.o +COBJS-$(CONFIG_VIDEO_MB86R0xGDC) += mb86r0xgdc.o videomodes.o COBJS-$(CONFIG_VIDEO_MX3) += mx3fb.o COBJS-$(CONFIG_VIDEO_SED13806) += sed13806.o COBJS-$(CONFIG_SED156X) += sed156x.o
drivers/video/mb86r0xgdc.c new file +186 -0
186 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH v5 3/3 arm: Add support for jadecpu board based on MB86R01 SoC
In reply to Matthias WeisserThis patch adds support for the jadecpu board using the MB86R01 'Jade' SoC from Fujitsu.
--- MAINTAINERS | 4 + MAKEALL | 1 + board/syteco/jadecpu/Makefile | 55 +++++++ board/syteco/jadecpu/config.mk | 1 + board/syteco/jadecpu/jadecpu.c | 170 ++++++++++++++++++++ board/syteco/jadecpu/lowlevel_init.S | 265 ++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/jadecpu.h | 294 ++++++++++++++++++++++++++++++++++ tools/Makefile | 3 + tools/logos/syteco.bmp | Bin 0 -> 11414 bytes 10 files changed, 794 insertions(+), 0 deletions(-) create mode 100644 board/syteco/jadecpu/Makefile create mode 100644 board/syteco/jadecpu/config.mk create mode 100644 board/syteco/jadecpu/jadecpu.c create mode 100644 board/syteco/jadecpu/lowlevel_init.S create mode 100644 include/configs/jadecpu.h create mode 100644 tools/logos/syteco.bmp
MAINTAINERS +4 -0
@@ -806,6 +806,10 @@ Prafulla Wadaskar <[email protected]> rd6281a ARM926EJS (Kirkwood SoC) sheevaplug ARM926EJS (Kirkwood SoC) +Matthias Weisser <[email protected]> + + jadecpu ARM926EJS (MB86R01 SoC) + Richard Woodruff <[email protected]> omap2420h4 ARM1136EJS
MAKEALL +1 -0
@@ -578,6 +578,7 @@ LIST_ARM9=" \ edminiv2 \ guruplug \ imx27lite \ + jadecpu \ lpd7a400 \ magnesium \ mv88f6281gtw_ge \
board/syteco/jadecpu/Makefile new file +55 -0
55 lines not on this page · raw message
board/syteco/jadecpu/config.mk new file +1 -0
@@ -0,0 +1 @@ +TEXT_BASE = 0x46000000
board/syteco/jadecpu/jadecpu.c new file +170 -0
170 lines not on this page · raw message
board/syteco/jadecpu/lowlevel_init.S new file +265 -0
265 lines not on this page · raw message
boards.cfg +1 -0
@@ -43,6 +43,7 @@ meesc arm arm926ejs - esd at91 otc570 arm arm926ejs - esd at91 pm9261 arm arm926ejs - ronetix at91 pm9263 arm arm926ejs - ronetix at91 +jadecpu arm arm926ejs jadecpu syteco mb86r0x suen3 arm arm926ejs km_arm keymile kirkwood rd6281a arm arm926ejs - Marvell kirkwood mx51evk arm armv7 mx51evk freescale mx51
include/configs/jadecpu.h new file +294 -0
294 lines not on this page · raw message
tools/Makefile +3 -0
@@ -118,6 +118,9 @@ endif ifeq ($(VENDOR),ronetix) LOGO_BMP= logos/ronetix.bmp endif +ifeq ($(VENDOR),syteco) +LOGO_BMP= logos/syteco.bmp +endif # now $(obj) is defined HOSTSRCS += $(addprefix $(SRCTREE)/,$(EXT_OBJ_FILES-y:.o=.c))
tools/logos/syteco.bmp new file binary +0 -0
zcmeI0%Z=PH42HG#1PG8ua at cbU$T=w at oy;*6q at L+)mXs;FTE_mvj+$Vm-;vzbIOp zpTGaTJ70d>ocj*7zwrA7zc=^Q_v1f*zJ*xcs%*@pwS<xpm#${eIu-^Dz~e3QPqq zP~cWsoRbp=!%6e0_7xyYP4OUX;&?@vBY<qNM)uXM3F5j;XIMfWw|<7cYm)1ac^7M zc7S$9X#t+$oJ&xgPAoJxGGiHnkfBtwoA;ZR9u>;?jzeRD@&naCCtPjCEmR=eG!^ zQa#o$6?*72<zqx*tjm)3O-CiiK?hHog62(Mq~7HoB}a0x;ak7h=tM3(H<iv#sH4S zt-*xFPF-j;ofqc}3yq2ZhcZIby>Za#nZ-J!3uVH0wB!+kgJR%EA9Aq12N0O(PQ6eZ z$UlR1&A~BJAO?q0Ht&BQ^&pBvVkAH;4hgb*DpU|ea%c>HA5&XnatM%u(qfa3l0mz z0>RTB%VAF#qXYSRB?sP6xgtpp8mxKWY_vft;lE&fTC{zc{EXkA}`|*TXPu)+dZQZ zgA|@|G<1>F8VBm0_P&(XUdBNj6{-<geK6xd-7}#_!8sX@ZYD<%W$HnK1FD!>u)I1x zeAfRI96^!S>k$<B3>>J)NRItNOh05iELAIfp)pd)w*{-%RbN;>-EZcML*E7Dy$EK2 z$8j8R?b=?CzP9E7ul#}*K<eLK&t!U_dGEEL2fqGb5W%s56gg}Vs-k}7Y>(s!AY~2{ zgq at kJTQ#USJV*tH0RpQ?tSVR84!UwXYWVjRRoIBr5JVzIL=MTiRfCLU2dUx^iU^FJ z{1KDSt&W3%NQ^#?xSH;Z($MZ;!O at pbG0K9I29A9yiP6K5&8&OnTX<urac$YB3XG_% zc4_xmAdMW7Ahd0F>0Se*g#-Qz+~i0*OpRzmO&p8Kk#d&nS0HU1i=ju(U3yG{baTYZ zbK0dnB0zdMFzwrpO1&JUlOuePN-phj2GYk7Fh(fS#St;if{=@D566LV9^}}v+N=(L v-!AOjQj8HG2a<6m=FVaZmJGf;QwXdp^U*bbS~I1ozV-x>`b|atPencepjJ52
literal 0
HcmV?d00001
Signature · 1 line
1.7.0.4