Skip to contentSkip to conversation

arm: Add support for MB86R01 'Jade' SoC

PATCH RESEND New Matthias Weisser 3 participants 11 messages Jul 8, 2009 – Jul 12, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover arm: Add support for MB86R01 'Jade' SoC

This patchset adds support for the MB86R01 'Jade' SoC from Fujitsu.

The second patch which adds the video driver needs this patch
http://lists.denx.de/pipermail/u-boot/2009-July/055582.html
which adds register offset definitions for the graphic controller.

This time I ran checkpatch.pl from the linux kernel sources for all patches and hopefully ignored only things which are not critical for inclusion of my source into u-boot.

Matthias Weisser

#1 lore raw

PATCH RESEND 1/3 arm: Added support for MB86R01 'Jade' SoC

This patch adds support for MB86R01 'Jade' SoC from Fujitsu

---
 cpu/arm926ejs/jade/Makefile          |   47 +++++++++
 cpu/arm926ejs/jade/timer.c           |  126 ++++++++++++++++++++++++
 include/asm-arm/arch-jade/hardware.h |   31 ++++++
 include/asm-arm/arch-jade/jade.h     |  177 ++++++++++++++++++++++++++++++++++
 4 files changed, 381 insertions(+), 0 deletions(-)
 create mode 100644 cpu/arm926ejs/jade/Makefile
 create mode 100644 cpu/arm926ejs/jade/timer.c
 create mode 100644 include/asm-arm/arch-jade/hardware.h
 create mode 100644 include/asm-arm/arch-jade/jade.h
cpu/arm926ejs/jade/Makefile new file +47 -0
new file mode 100644
index 0000000..7da9f40
@@ -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	= 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
+
+#########################################################################
cpu/arm926ejs/jade/timer.c new file +126 -0

126 lines not on this page · raw message

include/asm-arm/arch-jade/hardware.h new file +31 -0
new file mode 100644
index 0000000..a26bdca
@@ -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/jade.h>
+
+#endif
include/asm-arm/arch-jade/jade.h new file +177 -0

177 lines not on this page · raw message

Signature · 1 line
1.5.6.3
#2 lore raw

PATCH RESEND 2/3 arm: added support for display controller in Jade SoC

This patch adds support for the display controller in the MB86R01 'Jade' SoC.

---
 drivers/video/Makefile      |    1 +
 drivers/video/cfb_console.c |    2 +-
 drivers/video/jadegdc.c     |  192 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 194 insertions(+), 1 deletions(-)
 create mode 100644 drivers/video/jadegdc.c
drivers/video/Makefile +1 -0
index bc00852..ad4b0c9
@@ -30,6 +30,7 @@ COBJS-$(CONFIG_ATMEL_LCD) += atmel_lcdfb.o
 COBJS-$(CONFIG_CFB_CONSOLE) += cfb_console.o
 COBJS-$(CONFIG_S6E63D6) += s6e63d6.o
 COBJS-$(CONFIG_VIDEO_CT69000) += ct69000.o
+COBJS-$(CONFIG_VIDEO_JADEGDC) += jadegdc.o
 COBJS-$(CONFIG_VIDEO_MB862xx) += mb862xx.o
 COBJS-$(CONFIG_VIDEO_MX3) += mx3fb.o
 COBJS-$(CONFIG_VIDEO_SED13806) += sed13806.o
drivers/video/cfb_console.c +1 -1
index bcafb27..e23499f
@@ -314,7 +314,7 @@ void	console_cursor (int state);
 #else
 #define SWAP16(x)	 (x)
 #define SWAP32(x)	 (x)
-#if defined(VIDEO_FB_16BPP_PIXEL_SWAP)
+#if defined(VIDEO_FB_16BPP_PIXEL_SWAP) || defined(CONFIG_VIDEO_JADEGDC)
 #define SHORTSWAP32(x)	 ( ((x) >> 16) | ((x) << 16) )
 #else
 #define SHORTSWAP32(x)	 (x)
drivers/video/jadegdc.c new file +192 -0

192 lines not on this page · raw message

Signature · 1 line
1.5.6.3
#3 lore raw

PATCH RESEND 3/3 arm: Added support for jadecpu board based on Jade SoC

This patch adds support for the jadecpu board using the MB86R01 'Jade' SoC from Fujitsu.

---
 MAINTAINERS                          |    4 +
 MAKEALL                              |    1 +
 Makefile                             |    7 +
 board/syteco/jadecpu/Makefile        |   55 ++++++
 board/syteco/jadecpu/config.mk       |    1 +
 board/syteco/jadecpu/jadecpu.c       |   99 ++++++++++
 board/syteco/jadecpu/lowlevel_init.S |  337 ++++++++++++++++++++++++++++++++++
 include/configs/jadecpu.h            |  160 ++++++++++++++++
 tools/Makefile                       |    3 +
 tools/logos/syteco.bmp               |  Bin 0 -> 12278 bytes
 10 files changed, 667 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
index 9379c7e..157f437
@@ -671,6 +671,10 @@ Sergey Lapin <[email protected]>
 
 	afeb9260	ARM926EJS (AT91SAM9260 SoC)
 
+Matthias Weisser <[email protected]>
+
+	jadecpu	ARM926EJS (Jade SoC)
+
 -------------------------------------------------------------------------
 
 Unknown / orphaned boards:
MAKEALL +1 -0
index f4599d6..841c3d6
@@ -533,6 +533,7 @@ LIST_ARM9="			\
 	davinci_sffsdr		\
 	davinci_sonata		\
 	davinci_dm355evm	\
+	jadecpu				\
 "
 
 #########################################################################
Makefile +7 -0
index bcc81c9..0088d6d
@@ -2785,6 +2785,13 @@ at91sam9rlek_config	:	unconfig
 pm9263_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91
 
+#########################################################################
+## Different ARM926EJ-S Systems
+#########################################################################
+
+jadecpu_config	:	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm926ejs jadecpu syteco jade
+
 ########################################################################
 ## ARM Integrator boards - see doc/README-integrator for more info.
 integratorap_config	\
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
new file mode 100644
index 0000000..c661f0b
@@ -0,0 +1 @@
+TEXT_BASE = 0x46000000
board/syteco/jadecpu/jadecpu.c new file +99 -0

99 lines not on this page · raw message

board/syteco/jadecpu/lowlevel_init.S new file +337 -0

337 lines not on this page · raw message

include/configs/jadecpu.h new file +160 -0

160 lines not on this page · raw message

tools/Makefile +3 -0
index 43c284c..456e9dd
@@ -125,6 +125,9 @@ endif
 ifeq ($(VENDOR),ronetix)
 LOGO_BMP= logos/ronetix.bmp
 endif
+ifeq ($(VENDOR),syteco)
+LOGO_BMP= logos/syteco.bmp
+endif
 
 # now $(obj) is defined
 SRCS	+= $(addprefix $(SRCTREE)/,$(EXT_OBJ_FILES-y:.o=.c))
tools/logos/syteco.bmp new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..141ee8e10edd85caa52b9501e3a4381b81fe772d
GIT binary patch

zhaW%xehW+behuL(l>Wf)7yK^a^U at ywTZsRu;KA|g!}yt)yLX&3%A>CEstzCFdP^T zdt(f&J=<Se1cz6Vz2%xn8}kC7#8>(XPCrZWxxz)aQVUR*)s#%*H9UWBXrEA1QO&t zYstvm(XSvSGDIqb%bIEx at j1x-j~>EAlo=D;a@~oAc7b6ib0rJDLd at MXyUuWw7M5lh zfih3b_~Yq<Q0mM4sm&RQGEdX7KJAq(ZPTPs8d(~qNu#u~oQ5$_npsY+84IPE<=mPv zQ97`kn5KBBu^pKzRr@FeV}ujV0E-%key8+JPwjR%PSg-fL+v?Zuuzm~N*8k07B$EL zgOci{u%n!(&w*xPvQV*M3>M{ZnIT6kFp5Q@?7&zo5+*A-3K2%KXp{&O|B7Qh)*L|? zpC$*w76J<5c_x at E8fJ%u!)!vHl9NR{v&%xA at eq(0pD%ivp1}fG^iANr-ANEg*UW!q z5!3Wi7BY!(b&_ei5$V^gNKdw934IaoiAk}Vud1NtB)*p12iK3IL=Vr3MQz1&YHL z?g!T5(G$}<te52r@ir{UnfLG|IrA<o(V5;XSwN+d0eDBdHS-))l0rbu^5}5<7SE zRg$sjdj!8hEd8Lmjx~<>uXXIGz-iLz0M#^oeMge4T14zy+4)zzCKVrZ7jqYdS;U zK)-geMY1HAGK&er_EJ$=1t^vU#=&C1z*A)XDyd=veR|!7ux30g3PzkUMQIhlSTc-@ zMZgG@*7F4qsH=~K!AO*L798Qkj$n(W{oIW!FU?{FOAaOLb{j}7ih~CEHp_s~Z*R(> z0tFpD&{ka*OeKq?NOh&;XfR-ESl~bKOcsZ-5uyjHVwp at 9L&w#mVCq;V!xxvX86;tv zS at 1$sudaqOe;&gcN7#4x;acE%W?(k1=GfoP<lDj#DXX-Fy!*w!m^>X!E6i4vtgM zK%4GqiqZ>a!!mBRTo7yU$TR*rpd^+A%JbZc6eD%0s`up(SQ{|tgv^IC(h;nGKxaB^ J$T5U;;2&8xIXwUX

literal 0
HcmV?d00001

Signature · 1 line
1.5.6.3
#4 lore raw

PATCH RESEND 3/3 arm: Added support for jadecpu board based on Jade SoC

board/syteco/jadecpu/jadecpu.c line 44

Quoted 11 lines
board/syteco/jadecpu/jadecpu.c new file +11 -0
+{
+	printf("Boot reached stage %d\n", progress);
+}
+#endif
+
+static inline void delay(unsigned long loops)
+{
+	__asm__ volatile ("1:\n"
+		"subs %0, %1, #1\n"
+		"bne 1b" : "=r" (loops) : "0" (loops));
+}

no please remove

board/syteco/jadecpu/jadecpu.c line 53

Quoted 9 lines
board/syteco/jadecpu/jadecpu.c new file +9 -0
+
+/*
+ * Miscellaneous platform dependent initialisations
+ */
+
+int board_init(void)
+{
+	/* arch number of Versatile Board */
+	gd->bd->bi_arch_number = 0	/*MACH_TYPE_GSJADECPU*/;

nack
the arch number must be register properly

board/syteco/jadecpu/jadecpu.c line 55

Quoted 2 lines
board/syteco/jadecpu/jadecpu.c new file +2 -0
+	/* adress of boot parameters */
+	gd->bd->bi_boot_params = 0x47000000;

please use this style
RAM_BASE + X

board/syteco/jadecpu/jadecpu.c line 62

Quoted 7 lines
board/syteco/jadecpu/jadecpu.c new file +7 -0
+
+	gd->flags = 0;
+
+	icache_enable();
+
+	/* set Multiplex Group */
+	multiplex_group_init();

no please remove

board/syteco/jadecpu/jadecpu.c line 65

Quoted 3 lines
board/syteco/jadecpu/jadecpu.c new file +3 -0
+
+	/* init GPIOs */
+	gpio_init();

no please remove

Quoted 134 lines
board/syteco/jadecpu/jadecpu.c new file +34 -0
+
+	return 0;
+}
+
+int misc_init_r(void)
+{
+	setenv("verify", "n");
+	return 0;
+}
+
+/*
+ * DRAM configuration
+ */
+int dram_init(void)
+{
+	gd->bd->bi_dram[0].start = PHYS_SDRAM;
+	gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
+
+	return 0;
+}
+
+/*
+ * Initial the Pin Multiplex Groups
+ */
+void multiplex_group_init(void)
+{
+
+}
+
+void gpio_init(void)
+{
+
+}
+
board/syteco/jadecpu/lowlevel_init.S new file +94 -0
new file mode 100644
index 0000000..727eda5
@@ -0,0 +1,337 @@
+/*
+ * Board specific setup info
+ *
+ * (C) Copyright 2007, mycable GmbH
+ * Carsten Schneider <[email protected]>, Alexander Bigga <[email protected]>
+ *
+ * (C) Copyright 2007, mycable GmbH
+ * Carsten Schneider <[email protected]>, Alexander Bigga <[email protected]>
+ *
+ * (C) Copyright 2003, ARM Ltd.
+ * Philippe Robin, <[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 <config.h>
+#include <version.h>
+
+/* Set up the platform, once the cpu has been initialized */
+.globl lowlevel_init
+lowlevel_init:
+/*
+ * Initialize Clock Reset Generator (CRG)
+ */
+
+	ldr		r0, =0xfffe7000		/* CRG base address */
+
+	/* Not change the initial value that is set by external pin.*/
+1:	ldr		r2, [r0, #0x00]		/* Wait for PLLREADY */
+	tst		r2, #0x00000100
+	beq		1b
+
+	/* Set clock gate control */
+	ldr		r1, =0x0000ffff		/* Open */
+	str		r1, [r0, #0x18]		/* CRHA: AHB clock */
+	ldr		r1, =0x0000ffff		/* Open */
+	str		r1, [r0, #0x1c]		/* CRPA: APB-A clock */
+	ldr		r1, =0xfffffffe		/* Close */
+	str		r1, [r0, #0x20]		/* CRPA: APB-B clock */
+	ldr		r1, =0x0000ffff		/* Open */
+	str		r1, [r0, #0x24]		/* CRHB: ExtAHB clock */
+	ldr		r1, =0xffffffef		/* Open ARM926EJ-S only */
+	str		r1, [r0, #0x28]		/* CRAM: ARM core clock */
+
+/*
+ * Initialize External Bus Interface
+ */
+#define MEMC_BASE	0xfffc0000
+
+	ldr		r0, =MEMC_BASE		/* MEMC base address */
+
+	/*
+	 * SRAM/flash _mode_ registers (XCS4 is set by external pin)
+	 * XCS0: Ethernet Controller
+	 * XCS2: not used (?)
+	 * XCS4: Flash
+	 */
+	ldr		r1, =0x00000001		/* XCS0: 16bit */
+	str		r1, [r0, #0x00]
+	ldr		r1, =0x00000001		/* XCS2: 16bit */
+	str		r1, [r0, #0x08]
+	ldr		r1, =0x00000021		/* XCS4: 16bit, */
+	str		r1, [r0, #0x10]
+
+	/* SRAM/flash _timing_ registers (HCLK=83.3/80MHz) */
+	ldr		r1, =0x055ff00f		/* XCS0: */
+	str		r1, [r0, #0x20]
+	ldr		r1, =0x03061008		/* XCS2: not used */
+	str		r1, [r0, #0x28]
+	ldr		r1, =0x03061804		/* XCS4: FLASH ROM */
+	str		r1, [r0, #0x30]
+
+	/* SRAM/flash _area_ registers (address of XCS4 is set by hardware) */
+	ldr		r1, =0x00000020
+	str		r1, [r0, #0x40]
+	ldr		r1, =0x00000050		/* XCS2: 0x05000000/2MB */
+	str		r1, [r0, #0x48]
+	ldr		r1, =0x001f0000		/* XCS4: 32 MB */

board/syteco/jadecpu/lowlevel_init.S line 104

Quoted 10 lines
board/syteco/jadecpu/lowlevel_init.S new file +10 -0
+	str		r1, [r0, #0x50]
+
+/*
+ * GPIO Settings
+ */
+
+/*
+ * Initialize DDR2 Controller
+ */
+#define CCNT_BASE		0xfff42000

please move define to proper header

Quoted 22 lines
board/syteco/jadecpu/lowlevel_init.S new file +22 -0
+#define CDEBUG1		0xec
+
+#define DDR2C_BASE		0xf3000000
+#define DRIC			0x00
+#define DRIC1			0x02
+#define DRIC2			0x04
+#define DRCA			0x06
+#define DRCM			0x08
+#define DRCST1			0x0a
+#define DRCST2			0x0c
+#define DRCR			0x0e
+#define DRCF			0x20
+#define DRASR			0x30
+#define DRIMS			0x50
+#define DROS			0x60
+#define DRIBSLI		0x62
+#define DRIBSODT1		0x64
+#define DRIBSOCD		0x66
+#define DRIBSOCD2		0x68
+#define DROABA			0x70
+#define DROBV			0x80
+#define DROBS			0x84

board/syteco/jadecpu/lowlevel_init.S line 136

Quoted 10 lines
board/syteco/jadecpu/lowlevel_init.S new file +10 -0
+#define DROBSR1		0x86
+#define DROBSR2		0x88
+#define DROBSR3		0x8a
+#define DROBSR4		0x8c
+#define DRIMR1			0x90
+#define DRIMR2			0x92
+#define DRIMR3			0x94
+#define DRIMR4			0x96
+#define DROISR1		0x98
+#define DROISR2		0x9a

what is this define?

board/syteco/jadecpu/lowlevel_init.S line 144

Quoted 8 lines
board/syteco/jadecpu/lowlevel_init.S new file +8 -0
+
+	.macro wait, count
+	mov		r4, #\count
+3:
+	subs	r4, r4, #0x1
+	bne		3b
+
+	.endm

please use include/asm-arm/macro.h

Quoted 182 lines
board/syteco/jadecpu/lowlevel_init.S new file +182 -0
+
+	/* Wait for PLL LOCK up time or more */
+	wait	20
+
+	/*
+	 * (2) Initialize DDRIF
+	 */
+	ldr	r0, =DDR2C_BASE		/* DDR2C base address */
+	ldr	r1, =0x5555
+	strh	r1, [r0, #DRIMS]
+
+	/*
+	 * (3) Wait for 20MCKPs(120nsec) or more
+	 */
+	wait	20
+
+	/*
+	 * (4) IRESET/IUSRRST release
+	/*
+	ldr	r0, =CCNT_BASE		/* CCNT base address */
+	ldr	r1, =0x00000002
+	str	r1, [r0, #CDEBUG1]
+
+	/*
+	 * (5) Wait for 20MCKPs(120nsec) or more
+	 */
+	wait	20
+
+	/*
+	 * (6) IDLLRST release
+	 */
+	ldr	r0, =CCNT_BASE		/* CCNT base address */
+	ldr	r1, =0x00000003
+	str	r1, [r0, #CDEBUG1]
+
+	/*
+	 * (7+8) Wait for 200us(=200000ns) or more (DDR2 Spec)
+	 */
+	wait	33536
+
+	/*
+	 * (9) MCKE ON
+	 */
+	ldr	r0, =DDR2C_BASE		/* DDR2C base address */
+	ldr	r1, =0x003f
+	strh	r1, [r0, #DRIC1]
+	ldr	r1, =0x0000
+	strh	r1, [r0, #DRIC2]
+	ldr	r1, =0xc124		/* 512Mbit DDR2SDRAM x 2 */
+	strh	r1, [r0, #DRCA]
+	ldr	r1, =0xc000
+	strh	r1, [r0, #DRIC]
+
+	/*
+	 * (10) Initialize SDRAM
+	 */
+	ldr	r0, =DDR2C_BASE		/* DDR2C base address */
+	ldr	r1, =0xc001		/* NOP Command */
+	strh	r1, [r0, #DRIC]
+
+	wait	67			/* 400ns wait */
+
+	ldr	r1, =0x0017		/* PALL Command */
+	strh	r1, [r0, #DRIC1]
+	ldr	r1, =0x0400
+	strh	r1, [r0, #DRIC2]
+	ldr	r1, =0xc001
+	strh	r1, [r0, #DRIC]
+
+	ldr	r1, =0x0006		/* EMR(2) command */
+	strh	r1, [r0, #DRIC1]
+	ldr	r1, =0x0000
+	strh	r1, [r0, #DRIC2]
+	ldr	r1, =0xc001
+	strh	r1, [r0, #DRIC]
+
+	ldr	r1, =0x0007		/* EMR(3) command */
+	strh	r1, [r0, #DRIC1]
+	ldr	r1, =0x0000
+	strh	r1, [r0, #DRIC2]
+	ldr	r1, =0xc001
+	strh	r1, [r0, #DRIC]
+
+	ldr	r1, =0x0005		/* EMR(1) command */
+	strh	r1, [r0, #DRIC1]
+	ldr	r1, =0x0000		/* Extended Mode Register 1 clear*/
+	strh	r1, [r0, #DRIC2]
+	ldr	r1, =0xc001
+	strh	r1, [r0, #DRIC]
+
+	ldr	r1, =0x0004		/* MRS command */
+	strh	r1, [r0, #DRIC1]
+	ldr	r1, =0x0532		/* Mode Register */
+	strh	r1, [r0, #DRIC2]
+	ldr	r1, =0xc001
+	strh	r1, [r0, #DRIC]
+
+	wait 200
+
+	ldr	r1, =0x0017		/* PALL command */
+	strh	r1, [r0, #DRIC1]
+	ldr	r1, =0x0400
+	strh	r1, [r0, #DRIC2]
+	ldr	r1, =0xc001
+	strh	r1, [r0, #DRIC]
+
+	ldr	r1, =0x000f		/* REF command 1 */
+	strh	r1, [r0, #DRIC1]
+	ldr	r1, =0x0000		/* (changed) */
+	strh	r1, [r0, #DRIC2]
+	ldr	r1, =0xc001
+	strh	r1, [r0, #DRIC]
+
+	wait	18			/* 105ns wait */
+
+	ldr	r1, =0x0004		/* MRS command */
+	strh	r1, [r0, #DRIC1]
+	ldr	r1, =0x0432
+	strh	r1, [r0, #DRIC2]
+	ldr	r1, =0xc001
+	strh	r1, [r0, #DRIC]
+
+	wait	200			/* MRS to OCD: 200clock */
+
+	ldr	r1, =0x0005		/* EMR(1) command */
+	strh	r1, [r0, #DRIC1]
+	ldr	r1, =0x0380		/* Extended Mode Register 1 set OCD */
+	strh	r1, [r0, #DRIC2]
+	ldr	r1, =0xc001
+	strh	r1, [r0, #DRIC]
+
+	ldr	r1, =0x0005		/* EMR(1) command */
+	strh	r1, [r0, #DRIC1]
+	/* ldr  r1, =0x0044 */
+	ldr	r1, =0x0002		/* EMR(1) set reduced strength */
+	strh	r1, [r0, #DRIC2]
+	ldr	r1, =0xc001
+	strh	r1, [r0, #DRIC]
+
+	ldr	r1, =0x0032		/* Set BT, AL, CL, BL */
+	strh	r1, [r0, #DRCM]
+
+	ldr	r1, =0x3418		/* Set tRCD, tRAS, tRP, tRC */
+	strh	r1, [r0, #DRCST1]
+
+	/* ldr	r1, =0x2e22 */		/* Set tRFC, tRRD, tWR */
+	ldr	r1, =0x6e32
+	strh	r1, [r0, #DRCST2]
+
+	/* ldr	r1, =0x0051 */		/* Set CNTL, REF_CNT*/
+	ldr	r1, =0x0141		/* (changed) */
+	strh	r1, [r0, #DRCR]
+
+	ldr	r1, =0x0002		/* Set Address FIFO (8 steps) */
+	strh	r1, [r0, #DRCF]
+
+	ldr	r1, =0x0001		/* Enable AXI Cache */
+	strh	r1, [r0, #DRASR]
+
+	/*
+	 * (11) ODT setting
+	 */
+	ldr	r0, =DDR2C_BASE		 /* DDR2C base address */
+	ldr	r1, =0x0001
+	strh	r1, [r0, #DROBS]
+	ldr	r1, =0x0103		/* ODT auto adjustment on */
+	strh	r1, [r0, #DROABA]
+	ldr	r1, =0x003F		/* Set ODT to on 50/100 Ohm */
+	strh	r1, [r0, #DRIBSODT1]
+
+	/*
+	 * (12) Shift to ODTCONT ON (SDRAM side) and DDR2C usual operation mode
+	 */
+	ldr	r0, =DDR2C_BASE		 /* DDR2C base address */
+	ldr	r1, =0x0001
+	strh	r1, [r0, #DROS]
+	ldr	r1, =0x4000
+	strh	r1, [r0, #DRIC]
+
+	mov pc, lr
+
+/*

board/syteco/jadecpu/lowlevel_init.S line 336

Quoted 10 lines
board/syteco/jadecpu/lowlevel_init.S new file +10 -0
+ * Reset CPU by writing SWRSTREQ to CRSR-register
+ */
+.globl reset_cpu
+reset_cpu:
+	ldr	r0, =0xfffe7000		/* CRG Base address */
+	ldr	r2, =0x00000002		/* SWRSTREQ */
+	str	r2, [r0, #0x0c]
+
+_loop_forever:
+		b		_loop_forever

is it board or soc specific reset?

this ram init is board or soc specific?

Quoted 30 lines
board/syteco/jadecpu/lowlevel_init.S new file +1 -0
+
include/configs/jadecpu.h new file +23 -0
new file mode 100644
index 0000000..235d0b6
@@ -0,0 +1,160 @@
+/*
+ * (C) Copyright 2007-2008
+ * Matthias Weisser <[email protected]>
+ *
+ * Configuation settings for the AT91SAM9260EK & AT91SAM9G20EK boards.
+ *
+ * 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/configs/jadecpu.h line 33

Quoted 10 lines
include/configs/jadecpu.h new file +10 -0
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define CONFIG_SHOW_BOOT_PROGRESS 1
+
+#define CONFIG_SYS_HZ			1000
+#define CONFIG_JADE_IOCLK		(41500000)
+#define CONFIG_SYS_TIMERBASE	0xfffe0000

I guess it's soc specific so please move it to proper header

Quoted 34 lines
include/configs/jadecpu.h new file +34 -0
+
+#define CONFIG_ARM926EJS	1	/* This is an ARM926EJS Core	*/
+#undef CONFIG_USE_IRQ			/* we don't need IRQ/FIQ stuff	*/
+
+#define CONFIG_CMDLINE_TAG	1	/* enable passing of ATAGs	*/
+#define CONFIG_SETUP_MEMORY_TAGS 1
+#define CONFIG_INITRD_TAG	1
+
+/*
+ * Hardware drivers
+ */
+
+/*
+ * Serial
+ */
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE		(-4)
+#define CONFIG_SYS_NS16550_CLK			CONFIG_JADE_IOCLK
+#define CONFIG_SYS_NS16550_COM1			0xfffe1000
+#define CONFIG_SYS_NS16550_COM2			0xfffe2000
+
+#define CONFIG_CONS_INDEX	1
+
+/*
+ * Ethernet
+ */
+#define CONFIG_DRIVER_SMC911X		1
+#define CONFIG_DRIVER_SMC911X_BASE	0x02000000
+#define CONFIG_DRIVER_SMC911X_16_BIT
+
+/*
+ * Video
+ */

include/configs/jadecpu.h line 77

Quoted 10 lines
include/configs/jadecpu.h new file +10 -0
+#define CONFIG_VIDEO
+#define CONFIG_VIDEO_JADEGDC
+#define CONFIG_CFB_CONSOLE
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_VIDEO_LOGO
+#define CONFIG_SPLASH_SCREEN
+#define CONFIG_VIDEO_BMP_LOGO
+#define VIDEO_KBD_INIT_FCT		0
+#define VIDEO_TSTC_FCT			serial_tstc
+#define VIDEO_GETC_FCT			serial_getc

??
why?

Quoted 16 lines
include/configs/jadecpu.h new file +16 -0
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE	1
+#define CONFIG_BOOTP_BOOTPATH		1
+#define CONFIG_BOOTP_GATEWAY		1
+#define CONFIG_BOOTP_HOSTNAME		1
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_IMI

include/configs/jadecpu.h line 103

Quoted 10 lines
include/configs/jadecpu.h new file +10 -0
+#undef CONFIG_CMD_IMLS
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_SOURCE
+
+#define CONFIG_CMD_IMI		1
+#define CONFIG_CMD_ELF		1
+#define CONFIG_CMD_PING		1
+#define CONFIG_CMD_DHCP		1
+#define CONFIG_CMD_BMP		1
+/* #define CONFIG_CMD_USB		1 */

please no dead code

Best Regards,
J.

#5 lore raw

PATCH RESEND 3/3 arm: Added support for jadecpu board based on Jade SoC

Hello Jean-Christophe

Quoted 5 lines

board/syteco/jadecpu/jadecpu.c line 53

Quoted 4 lines
board/syteco/jadecpu/jadecpu.c new file +4 -0
+int board_init(void)
+{
+	/* arch number of Versatile Board */
+	gd->bd->bi_arch_number = 0	/*MACH_TYPE_GSJADECPU*/;

nack

How to get a arch number? As I don't use Linux on that board I don't think I need one. What is the right way to handle such a situation? Dont't set bi_arch_number at all?

Quoted 27 lines
Quoted 1 line

+#define CCNT_BASE 0xfff42000

please move define to proper header

Quoted 25 lines
board/syteco/jadecpu/lowlevel_init.S new file +25 -0
+#define CDEBUG1		0xec
+
+#define DDR2C_BASE		0xf3000000
+#define DRIC			0x00
+#define DRIC1			0x02
+#define DRIC2			0x04
+#define DRCA			0x06
+#define DRCM			0x08
+#define DRCST1			0x0a
+#define DRCST2			0x0c
+#define DRCR			0x0e
+#define DRCF			0x20
+#define DRASR			0x30
+#define DRIMS			0x50
+#define DROS			0x60
+#define DRIBSLI		0x62
+#define DRIBSODT1		0x64
+#define DRIBSOCD		0x66
+#define DRIBSOCD2		0x68
+#define DROABA			0x70
+#define DROBV			0x80
+#define DROBS			0x84
+#define DROBSR1		0x86
+#define DROBSR2		0x88
+#define DROBSR3		0x8a
Quoted 8 lines

board/syteco/jadecpu/lowlevel_init.S line 136

Quoted 7 lines
board/syteco/jadecpu/lowlevel_init.S new file +7 -0
+#define DROBSR4		0x8c
+#define DRIMR1			0x90
+#define DRIMR2			0x92
+#define DRIMR3			0x94
+#define DRIMR4			0x96
+#define DROISR1		0x98
+#define DROISR2		0x9a

what is this define?

I will check this and move the needed ones to jade.h

Quoted 9 lines

board/syteco/jadecpu/lowlevel_init.S line 144

Quoted 8 lines
board/syteco/jadecpu/lowlevel_init.S new file +8 -0
+
+	.macro wait, count
+	mov		r4, #\count
+3:
+	subs	r4, r4, #0x1
+	bne		3b
+
+	.endm

please use include/asm-arm/macro.h

I don't have this file here. Is it currently included in the master branch of u-boot?

Quoted 4 lines
Quoted 4 lines

+/*
+ * Reset CPU by writing SWRSTREQ to CRSR-register
+ */
+.globl reset_cpu

Quoted 8 lines

board/syteco/jadecpu/lowlevel_init.S line 336

Quoted 7 lines
board/syteco/jadecpu/lowlevel_init.S new file +7 -0
+reset_cpu:
+	ldr	r0, =0xfffe7000		/* CRG Base address */
+	ldr	r2, =0x00000002		/* SWRSTREQ */
+	str	r2, [r0, #0x0c]
+
+_loop_forever:
+		b		_loop_forever

is it board or soc specific reset?

Reset is soc specific. I will move it to reset.c in the soc dir. Right?

Quoted 1 line

this ram init is board or soc specific?

RAM init is board specific as the soc could use other RAM configurations on other boards. So I think it should stay here.

Quoted 4 lines

include/configs/jadecpu.h line 33

Quoted 3 lines
include/configs/jadecpu.h new file +3 -0
+#define CONFIG_SYS_HZ			1000
+#define CONFIG_JADE_IOCLK		(41500000)
+#define CONFIG_SYS_TIMERBASE	0xfffe0000

I guess it's soc specific so please move it to proper header

For the timer base, yes.

Quoted 5 lines

include/configs/jadecpu.h line 77

Quoted 3 lines
include/configs/jadecpu.h new file +3 -0
+#define VIDEO_KBD_INIT_FCT		0
+#define VIDEO_TSTC_FCT			serial_tstc
+#define VIDEO_GETC_FCT			serial_getc

??
why?

Well, copy + paste from other board. Even if video is stdout/stdin serial port is used for input. Better way would be...?

I will fix the points from the other mails also.

Thanks for your time,
Matthias

------------------------------------
Amtsgericht Freiburg HRA 602707
Ust. ID-Nr.: DE232464428

Gesch?ftsf?hrer:
Dipl. Ing. (FH) Martin Graf
Dipl. Ing. (FH) David Graf
Dipl. Inf. Fabian Graf

Komplement?rin:
GRAF-SYTECO Verwaltungs-GmbH
Amtsgericht Freiburg HRB 602868
------------------------------------

#6 lore raw

PATCH RESEND 3/3 arm: Added support for jadecpu board based on Jade SoC

Quoted 11 lines · Matthias Weisser

Hello Jean-Christophe

Quoted 5 lines

board/syteco/jadecpu/jadecpu.c line 53

Quoted 4 lines
board/syteco/jadecpu/jadecpu.c new file +4 -0
+int board_init(void)
+{
+	/* arch number of Versatile Board */
+	gd->bd->bi_arch_number = 0	/*MACH_TYPE_GSJADECPU*/;

nack

How to get a arch number? As I don't use Linux on that board I don't think I need one. What is the right way to handle such a situation? Dont't set bi_arch_number at all?

you have no plan to support linux?
if not, just do not add it and disable linux boot support btw please put a comment in the config about it

Quoted 49 lines
Quoted 28 lines
Quoted 2 lines

+#define CCNT_BASE 0xfff42000

please move define to proper header

Quoted 25 lines
board/syteco/jadecpu/lowlevel_init.S new file +25 -0
+#define CDEBUG1		0xec
+
+#define DDR2C_BASE		0xf3000000
+#define DRIC			0x00
+#define DRIC1			0x02
+#define DRIC2			0x04
+#define DRCA			0x06
+#define DRCM			0x08
+#define DRCST1			0x0a
+#define DRCST2			0x0c
+#define DRCR			0x0e
+#define DRCF			0x20
+#define DRASR			0x30
+#define DRIMS			0x50
+#define DROS			0x60
+#define DRIBSLI		0x62
+#define DRIBSODT1		0x64
+#define DRIBSOCD		0x66
+#define DRIBSOCD2		0x68
+#define DROABA			0x70
+#define DROBV			0x80
+#define DROBS			0x84
+#define DROBSR1		0x86
+#define DROBSR2		0x88
+#define DROBSR3		0x8a
Quoted 8 lines

board/syteco/jadecpu/lowlevel_init.S line 136

Quoted 7 lines
board/syteco/jadecpu/lowlevel_init.S new file +7 -0
+#define DROBSR4		0x8c
+#define DRIMR1			0x90
+#define DRIMR2			0x92
+#define DRIMR3			0x94
+#define DRIMR4			0x96
+#define DROISR1		0x98
+#define DROISR2		0x9a

what is this define?

I will check this and move the needed ones to jade.h

Quoted 9 lines

board/syteco/jadecpu/lowlevel_init.S line 144

Quoted 8 lines
board/syteco/jadecpu/lowlevel_init.S new file +8 -0
+
+	.macro wait, count
+	mov		r4, #\count
+3:
+	subs	r4, r4, #0x1
+	bne		3b
+
+	.endm

please use include/asm-arm/macro.h

Quoted 2 lines

I don't have this file here. Is it currently included in the master branch of u-boot?

yes

Quoted 14 lines
Quoted 13 lines

board/syteco/jadecpu/lowlevel_init.S line 336

Quoted 12 lines
board/syteco/jadecpu/lowlevel_init.S new file +11 -0
+/*
+ * Reset CPU by writing SWRSTREQ to CRSR-register
+ */
+.globl reset_cpu
+reset_cpu:
+	ldr	r0, =0xfffe7000		/* CRG Base address */
+	ldr	r2, =0x00000002		/* SWRSTREQ */
+	str	r2, [r0, #0x0c]
+
+_loop_forever:
+		b		_loop_forever

is it board or soc specific reset?

Quoted 2 lines

Reset is soc specific. I will move it to reset.c in the soc dir. Right?

yes please

Quoted 13 lines
Quoted 2 lines

this ram init is board or soc specific?

RAM init is board specific as the soc could use other RAM configurations on other boards. So I think it should stay here.

Quoted 4 lines

include/configs/jadecpu.h line 33

Quoted 3 lines
include/configs/jadecpu.h new file +3 -0
+#define CONFIG_SYS_HZ			1000
+#define CONFIG_JADE_IOCLK		(41500000)
+#define CONFIG_SYS_TIMERBASE	0xfffe0000

I guess it's soc specific so please move it to proper header

For the timer base, yes.

Quoted 8 lines
Quoted 5 lines

include/configs/jadecpu.h line 77

Quoted 3 lines
include/configs/jadecpu.h new file +3 -0
+#define VIDEO_KBD_INIT_FCT		0
+#define VIDEO_TSTC_FCT			serial_tstc
+#define VIDEO_GETC_FCT			serial_getc

??
why?

Well, copy + paste from other board. Even if video is stdout/stdin serial port is used for input. Better way would be...?

please use device_t in this case
and set via preboot the correct stdout/stderr
you can also consider to add iomux support so you can use both at the sametime

Best Regards,
J.

#7 lore raw

PATCH RESEND 2/3 arm: added support for display controller in Jade SoC

In reply to Matthias Weisser
Quoted 76 lines · Matthias Weisser

This patch adds support for the display controller in the MB86R01 'Jade' SoC.

---
 drivers/video/Makefile      |    1 +
 drivers/video/cfb_console.c |    2 +-
 drivers/video/jadegdc.c     |  192 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 194 insertions(+), 1 deletions(-)
 create mode 100644 drivers/video/jadegdc.c
drivers/video/Makefile +1 -0
index bc00852..ad4b0c9
@@ -30,6 +30,7 @@ COBJS-$(CONFIG_ATMEL_LCD) += atmel_lcdfb.o
 COBJS-$(CONFIG_CFB_CONSOLE) += cfb_console.o
 COBJS-$(CONFIG_S6E63D6) += s6e63d6.o
 COBJS-$(CONFIG_VIDEO_CT69000) += ct69000.o
+COBJS-$(CONFIG_VIDEO_JADEGDC) += jadegdc.o
 COBJS-$(CONFIG_VIDEO_MB862xx) += mb862xx.o
 COBJS-$(CONFIG_VIDEO_MX3) += mx3fb.o
 COBJS-$(CONFIG_VIDEO_SED13806) += sed13806.o
drivers/video/cfb_console.c +1 -1
index bcafb27..e23499f
@@ -314,7 +314,7 @@ void	console_cursor (int state);
 #else
 #define SWAP16(x)	 (x)
 #define SWAP32(x)	 (x)
-#if defined(VIDEO_FB_16BPP_PIXEL_SWAP)
+#if defined(VIDEO_FB_16BPP_PIXEL_SWAP) || defined(CONFIG_VIDEO_JADEGDC)
 #define SHORTSWAP32(x)	 ( ((x) >> 16) | ((x) << 16) )
 #else
 #define SHORTSWAP32(x)	 (x)
drivers/video/jadegdc.c new file +34 -0
new file mode 100644
index 0000000..d3f68ab
@@ -0,0 +1,192 @@
+/*
+ * (C) Copyright 2007-2009
+ * 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
+ */
+
+/*
+ * jade.c - Graphic interface for Fujitsu Jade integrated graphic
+ * controller. Derived from mb862xx.c
+ */
+
+#include <common.h>
+
+#include <malloc.h>
+#include <mb862xx.h>
+#include <asm/io.h>
+#include <video_fb.h>

drivers/video/jadegdc.c line 44

Quoted 10 lines
drivers/video/jadegdc.c new file +10 -0
+#include "videomodes.h"
+
+/*
+ * 4MB (at the end of system RAM)
+ */
+#define VIDEO_MEM_SIZE		0x400000
+
+#define GDC_HOST_BASE		0xF1FC0000
+#define GDC_DSP0_BASE		0xF1FD0000
+#define GDC_DSP1_BASE		0xF1FD2000

please move to a header

drivers/video/jadegdc.c line 49

Quoted 5 lines
drivers/video/jadegdc.c new file +5 -0
+
+/*
+ * Graphic Device
+ */
+GraphicDevice jadegdc;

please no uppercase in type

Best Regards,
J.

#8 lore raw

PATCH RESEND 2/3 arm: added support for display controller in Jade SoC

Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 5 lines · Matthias Weisser

This patch adds support for the display controller in the MB86R01 'Jade' SoC.

---

...

Quoted 10 lines

drivers/video/jadegdc.c line 44

Quoted 9 lines
drivers/video/jadegdc.c new file +9 -0
+
+/*
+ * 4MB (at the end of system RAM)
+ */
+#define VIDEO_MEM_SIZE		0x400000
+
+#define GDC_HOST_BASE		0xF1FC0000
+#define GDC_DSP0_BASE		0xF1FD0000
+#define GDC_DSP1_BASE		0xF1FD2000

please move to a header

probably we should drop these entirely and use JADE_GDC_PHYS_BASE and JADE_GDC_PHYS_DISP_BASE from include/asm-arm/arch-jade/jade.h file introduced with this patch series? Just need to add the base for second display controller register block there.

...

Quoted 2 lines
Quoted 1 line

+GraphicDevice jadegdc;

please no uppercase in type

we have to stay with GraphicDevice type in this patch now. It is there in U-Boot code since more than five years, Matthias simply uses it here as other video drivers use it, too. But yes, we should do general video code cleanup later.

Best regards,
Anatolij

#9 lore raw

PATCH RESEND 2/3 arm: added support for display controller in Jade SoC

Quoted 24 lines · Anatolij Gustschin
Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 5 lines · Matthias Weisser

This patch adds support for the display controller in the MB86R01 'Jade' SoC.

---

...

Quoted 10 lines

drivers/video/jadegdc.c line 44

Quoted 9 lines
drivers/video/jadegdc.c new file +9 -0
+
+/*
+ * 4MB (at the end of system RAM)
+ */
+#define VIDEO_MEM_SIZE		0x400000
+
+#define GDC_HOST_BASE		0xF1FC0000
+#define GDC_DSP0_BASE		0xF1FD0000
+#define GDC_DSP1_BASE		0xF1FD2000

please move to a header

probably we should drop these entirely and use JADE_GDC_PHYS_BASE and JADE_GDC_PHYS_DISP_BASE from include/asm-arm/arch-jade/jade.h file introduced with this patch series? Just need to add the base for second display controller register block there.

Quoted 8 lines

...

Quoted 2 lines
Quoted 1 line

+GraphicDevice jadegdc;

please no uppercase in type

we have to stay with GraphicDevice type in this patch now. It is there in U-Boot code since more than five years, Matthias simply uses it here as other video drivers use it, too. But yes, we should do general video code cleanup later.

ok fine

Best Regards,
J.

#10 lore raw

PATCH RESEND 1/3 arm: Added support for MB86R01 'Jade' SoC

In reply to Matthias Weisser
Quoted 94 lines · Matthias Weisser

This patch adds support for MB86R01 'Jade' SoC from Fujitsu

---
 cpu/arm926ejs/jade/Makefile          |   47 +++++++++
 cpu/arm926ejs/jade/timer.c           |  126 ++++++++++++++++++++++++
 include/asm-arm/arch-jade/hardware.h |   31 ++++++
 include/asm-arm/arch-jade/jade.h     |  177 ++++++++++++++++++++++++++++++++++
 4 files changed, 381 insertions(+), 0 deletions(-)
 create mode 100644 cpu/arm926ejs/jade/Makefile
 create mode 100644 cpu/arm926ejs/jade/timer.c
 create mode 100644 include/asm-arm/arch-jade/hardware.h
 create mode 100644 include/asm-arm/arch-jade/jade.h
cpu/arm926ejs/jade/Makefile new file +47 -0
new file mode 100644
index 0000000..7da9f40
@@ -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	= 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
+
+#########################################################################
cpu/arm926ejs/jade/timer.c new file +21 -0
new file mode 100644
index 0000000..2d262c8
@@ -0,0 +1,126 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop <[email protected]>
+ * Lead Tech Design <www.leadtechdesign.com>
+ *
+ * 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

cpu/arm926ejs/jade/timer.c line 31

Quoted 10 lines
cpu/arm926ejs/jade/timer.c new file +10 -0
+ * 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 <div64.h>
+
+#define TIMER_LOAD_VAL 0xffffffff
+#define TIMER_BASE     0xfffe0000

whitespace please fix

cpu/arm926ejs/jade/timer.c line 34

Quoted 3 lines
cpu/arm926ejs/jade/timer.c new file +3 -0
+
+#define READ_TIMER (*(volatile ulong *)(TIMER_BASE+4))
+#define TIMER_FREQ     (CONFIG_JADE_IOCLK  / 16)

whitespace please fix

Quoted 15 lines
cpu/arm926ejs/jade/timer.c new file +15 -0
+
+static ulong timestamp;
+static ulong lastdec;
+
+static inline unsigned long long tick_to_time(unsigned long long tick)
+{
+	tick *= CONFIG_SYS_HZ;
+	do_div(tick, TIMER_FREQ);
+
+	return tick;
+}
+
+static inline unsigned long long usec_to_tick(unsigned long long usec)
+{
+	usec *= TIMER_FREQ;

cpu/arm926ejs/jade/timer.c line 59

Quoted 10 lines
cpu/arm926ejs/jade/timer.c new file +10 -0
+	do_div(usec, 1000000);
+
+	return usec;
+}
+
+/* nothing really to do with interrupts, just starts up a counter. */
+int timer_init(void)
+{
+	*(volatile ulong *)(TIMER_BASE + 0) = TIMER_LOAD_VAL;
+	*(volatile ulong *)(TIMER_BASE + 8) = 0x86;

please use proper accessor readx/writex

Quoted 56 lines
cpu/arm926ejs/jade/timer.c new file +56 -0
+
+	reset_timer_masked();
+
+	return 0;
+}
+
+/*
+ * timer without interrupts
+ */
+unsigned long long get_ticks(void)
+{
+	ulong now = READ_TIMER;
+
+	if (now <= lastdec)	/* normal mode (non roll) */
+		/* move stamp forward with absolut diff ticks */
+		timestamp += (lastdec - now);
+	else			/* we have rollover of incrementer */
+		timestamp += lastdec + TIMER_LOAD_VAL - now;
+	lastdec = now;
+	return timestamp;
+}
+
+void reset_timer_masked(void)
+{
+	/* reset time */
+	lastdec = READ_TIMER;	/* capture current decrement value time */
+	timestamp = 0;		/* start "advancing" time stamp from 0 */
+}
+
+ulong get_timer_masked(void)
+{
+	return tick_to_time(get_ticks());
+}
+
+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*/;
+}
+
+void reset_timer(void)
+{
+	reset_timer_masked();
+}
+
+ulong get_timer(ulong base)
+{
+	return get_timer_masked() - base;
+}
+

cpu/arm926ejs/jade/timer.c line 125

Quoted 10 lines
cpu/arm926ejs/jade/timer.c new file +10 -0
+/*
+ * This function is derived from PowerPC code (timebase clock frequency).
+ * On ARM it returns the number of timer ticks per second.
+ */
+ulong get_tbclk(void)
+{
+	ulong tbclk;
+
+	tbclk = CONFIG_SYS_HZ;
+	return tbclk;

please return it directly

Quoted 86 lines
cpu/arm926ejs/jade/timer.c new file +1 -0
+}
include/asm-arm/arch-jade/hardware.h new file +31 -0
new file mode 100644
index 0000000..a26bdca
@@ -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/jade.h>
+
+#endif
include/asm-arm/arch-jade/jade.h new file +42 -0
new file mode 100644
index 0000000..c2b28a2
@@ -0,0 +1,177 @@
+/*
+ * (C) Copyright 2007
+ *
+ * jade definitions
+ *
+ * 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 JADE_H
+#define JADE_H
+
+typedef	volatile unsigned int	JREG;	/* Hardware register */
+
+/*
+ * Physical Address Defines
+ */
+#define JADE_GDC_PHYS_BASE	0xf1fc0000
+#define JADE_GDC_PHYS_DISP_BASE	0xf1fd0000
+#define JADE_CCNT_PHYS_BASE	0xfff42000
+#define JADE_CAN0_PHYS_BASE	0xfff54000
+#define JADE_CAN1_PHYS_BASE	0xfff55000
+#define JADE_I2C0_PHYS_BASE	0xfff56000
+#define JADE_I2C1_PHYS_BASE	0xfff57000

include/asm-arm/arch-jade/jade.h line 52

Quoted 10 lines
include/asm-arm/arch-jade/jade.h new file +10 -0
+#define JADE_EHCI_PHYS_BASE	0xfff80000
+#define JADE_OHCI_PHYS_BASE	0xfff81000
+#define JADE_IRC1_PHYS_BASE	0xfffb0000
+#define JADE_TIMER_PHYS_BASE	0xfffe0000
+#define JADE_UART0_PHYS_BASE	0xfffe1000
+#define JADE_UART1_PHYS_BASE	0xfffe2000
+#define JADE_IRCE_PHYS_BASE	0xfffe4000
+#define JADE_CRG_PHYS_BASE	0xfffe7000
+#define JADE_IRC0_PHYS_BASE	0xfffe8000
+#define JADE_GPIO_PHYS_BASE	0xfffe9000

please align them

include/asm-arm/arch-jade/jade.h line 60

Quoted 8 lines
include/asm-arm/arch-jade/jade.h new file +8 -0
+
+
+/* DRAMC_DRIC DRAM Controller Mode Register */
+
+/*
+ * REGISTER ADDRESS DEFINITION FOR DRAMC PERIPHERAL
+ */
+#define JREGC_DRAMC_DRIC	((JREG *) 0xF3000000)

please remove the JREG everywhere as no need when use proper accessor

Best Regards,
J.