This patch adds support for Fujitsu MB86R01 'JADE' SOC
Subsystems (3)
PATCH 1/1 This patch adds support for Fujitsu MB86R01 'JADE' SOC
--- cpu/arm926ejs/jade/Makefile | 47 +++++++++ cpu/arm926ejs/jade/timer.c | 129 ++++++++++++++++++++++++ include/asm-arm/arch-jade/hardware.h | 31 ++++++ include/asm-arm/arch-jade/jade.h | 182 ++++++++++++++++++++++++++++++++++ 4 files changed, 389 insertions(+), 0 deletions(-) create mode 100755 cpu/arm926ejs/jade/Makefile create mode 100755 cpu/arm926ejs/jade/timer.c create mode 100755 include/asm-arm/arch-jade/hardware.h create mode 100755 include/asm-arm/arch-jade/jade.h
cpu/arm926ejs/jade/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 = 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 +129 -0
129 lines not on this page · raw message
include/asm-arm/arch-jade/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/jade.h> + +#endif
include/asm-arm/arch-jade/jade.h new file +182 -0
182 lines not on this page · raw message
Signature · 1 line
1.5.6.3
PATCH 1/1 Add suport for the graphic controller included in the JADE SOC
--- drivers/video/jadegdc.c | 205 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 205 insertions(+), 0 deletions(-) create mode 100755 drivers/video/jadegdc.c
drivers/video/jadegdc.c new file +205 -0
@@ -0,0 +1,205 @@ +/* +* (C) Copyright 2007 +* DENX Software Engineering, Anatolij Gustschin, agust 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 +*/ + +/* +* jade.c - Graphic interface for Fujitsu Jade integrated graphic +* controller. Derived from mb862xx.c +*/ + +#include <common.h> + +#if defined(CONFIG_VIDEO_JADEGDC ) + +#include <malloc.h> +#include <asm/io.h> +#include <video_fb.h> +#include "videomodes.h" + +#if defined(CONFIG_POST ) +#include <post.h> +#endif + +/* +* 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 + +/* +* Graphic Device +*/ +GraphicDevice jadegdc; + +void *video_hw_init (void ) +{ +GraphicDevice *pGD = (GraphicDevice *)&jadegdc; +struct ctfb_res_modes var_mode[2 ]; +unsigned long * vid; +unsigned long div; +unsigned long dspBase[2 ]; +char *penv; +int bpp; +int i, j; + +memset (pGD,0 ,sizeof (GraphicDevice)); + + dspBase[0 ] =GDC_DSP0_BASE ; + dspBase[1 ] =GDC_DSP1_BASE ; + +/* Preliminary init of the onboard graphic controller, +retrieve base address */ +if ((pGD->frameAdrs =GDC_HOST_BASE ) ==0 ) { +printf ("Controller not found!\n" ); +return (NULL ); + } + + pGD->gdfIndex =GDF_15BIT_555RGB ; + pGD->gdfBytesPP =2 ; + + pGD->memSize =VIDEO_MEM_SIZE ; + pGD->frameAdrs =PHYS_SDRAM +PHYS_SDRAM_SIZE -VIDEO_MEM_SIZE ; + vid = (unsigned long *)pGD->frameAdrs; + +for (i =0 ; i <2 ; i++) + { +char varName[32 ]; +u32 dcm1, dcm2, dcm3; +u16 htp, hdp, hdb, hsp, vtr, vsp, vdp; +u8 hsw, vsw; +u32 l2m, l2em, l2oa0, l2da0, l2oa1, l2da1; +u16 l2dx, l2dy, l2wx, l2wy, l2ww, l2wh; + +sprintf (varName,"gs_dsp_%d_param" , i); + +if (NULL == (penv =getenv (varName))) +if (NULL == (penv =getenv ("videomode" ))) +continue ; + + bpp =0 ; + bpp =video_get_params (&var_mode[i], penv); + +if (0 == bpp){ + var_mode[i].xres =640 ; + var_mode[i].yres =480 ; + var_mode[i].pixclock =39721 ;/* 25MHz */ + var_mode[i].left_margin =48 ; + var_mode[i].right_margin =16 ; + var_mode[i].upper_margin =33 ; + var_mode[i].lower_margin =10 ; + var_mode[i].hsync_len =96 ; + var_mode[i].vsync_len =2 ; + var_mode[i].sync =0 ; + var_mode[i].vmode =0 ; + } + +for (j =0 ; j < var_mode[i].xres * var_mode[i].yres /2 ; j++) + { + *vid++ =0xFFFFFFFF ; + } + + pGD->winSizeX = var_mode[i].xres; + pGD->winSizeY = var_mode[i].yres; + +/* LCD base clock is ~ 660MHZ. We do calculations in kHz */ + div =660000 / (1000000000L / var_mode[i].pixclock); +if (div >64 ) + div =64 ; + + dcm1 = div <<8 ; + dcm2 =0x00000000 ; + dcm3 =0x00000000 ; + + htp = var_mode[i].left_margin + var_mode[i].xres + var_mode[i].hsync_len + var_mode[i].right_margin; + hdp = var_mode[i].xres; + hdb = var_mode[i].xres; + hsp = var_mode[i].xres + var_mode[i].right_margin; + hsw = var_mode[i].hsync_len; + + vsw = var_mode[i].vsync_len; + vtr = var_mode[i].upper_margin + var_mode[i].yres + var_mode[i].vsync_len + var_mode[i].lower_margin; + vsp = var_mode[i].yres + var_mode[i].lower_margin; + vdp = var_mode[i].yres; + + l2m = ( (var_mode[i].yres-1 ) << (0 )) | + (((var_mode[i].xres *2 )/64 ) << (16 )) | + ( (1 ) << (31 )); + + l2em = (1 <<0 ) | (1 <<1 ); + + l2oa0 = pGD->frameAdrs; + l2da0 = pGD->frameAdrs; + l2oa1 = pGD->frameAdrs; + l2da1 = pGD->frameAdrs; + l2dx =0 ; + l2dy =0 ; + l2wx =0 ; + l2wy =0 ; + l2ww = var_mode[i].xres; + l2wh = var_mode[i].yres -1 ; + +writel (dcm1, dspBase[i] +0x100 ); +writel (dcm2, dspBase[i] +0x104 ); +writel (dcm3, dspBase[i] +0x108 ); + +writew (htp, dspBase[i] +0x006 ); +writew (hdp, dspBase[i] +0x008 ); +writew (hdb, dspBase[i] +0x00A ); +writew (hsp, dspBase[i] +0x00C ); +writeb (hsw, dspBase[i] +0x00E ); + +writeb (vsw, dspBase[i] +0x00F ); +writew (vtr, dspBase[i] +0x012 ); +writew (vsp, dspBase[i] +0x014 ); +writew (vdp, dspBase[i] +0x016 ); + +writel ( l2m, dspBase[i] +0x040 ); +writel ( l2em, dspBase[i] +0x130 ); +writel (l2oa0, dspBase[i] +0x044 ); +writel (l2da0, dspBase[i] +0x048 ); +writel (l2oa1, dspBase[i] +0x04C ); +writel (l2da1, dspBase[i] +0x050 ); +writew ( l2dx, dspBase[i] +0x054 ); +writew ( l2dy, dspBase[i] +0x056 ); +writew ( l2wx, dspBase[i] +0x134 ); +writew ( l2wy, dspBase[i] +0x136 ); +writew ( l2ww, dspBase[i] +0x138 ); +writew ( l2wh, dspBase[i] +0x13A ); + +writel (dcm1 | (1 <<18 ) | (1 <<31 ), dspBase[i] +0x100 ); + } + +return pGD; +} + +/* +* Set a RGB color in the LUT +*/ +void video_set_lut (unsigned int index,unsigned char r,unsigned char g,unsigned char b) +{ + +} + +#endif /* CONFIG_VIDEO_JADEGDC */
Signature · 1 line
1.5.6.3
PATCH 1/1 Added support for splash screen positioning adding by adding
--- drivers/video/cfb_console.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) mode change 100644 => 100755 drivers/video/cfb_console.c
drivers/video/cfb_console.c +10 -2
@@ -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)
@@ -1188,9 +1188,17 @@ static void *video_logo (void)ulong addr;if ((s =getenv ("splashimage" )) !=NULL ) { +int x =0 , y =0 ; + addr =simple_strtoul (s,NULL ,16 ); -if (video_display_bitmap (addr,0 ,0 ) ==0 ) { +if ((s =strchr (s,' ' )) !=NULL ) { + x =simple_strtoul (s +1 ,NULL ,0 ); +if ((s =strchr (s +1 ,' ' )) !=NULL ) + y =simple_strtoul (s +1 ,NULL ,0 ); + } + +if (video_display_bitmap (addr, x, y) ==0 ) {return ((void *) (video_fb_address)); } }
Signature · 1 line
1.5.6.3
PATCH 1/1 Added support for jadecpu board using the MB86R01 'Jade' SOC from Fujitsu
--- MAINTAINERS | 3 + 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 | 173 +++++++++++++++++ tools/Makefile | 3 + tools/logos/syteco.bmp | Bin 0 -> 12278 bytes 10 files changed, 679 insertions(+), 0 deletions(-) mode change 100644 => 100755 MAINTAINERS mode change 100644 => 100755 Makefile create mode 100755 board/syteco/jadecpu/Makefile create mode 100755 board/syteco/jadecpu/config.mk create mode 100755 board/syteco/jadecpu/jadecpu.c create mode 100755 board/syteco/jadecpu/lowlevel_init.S create mode 100755 include/configs/jadecpu.h mode change 100644 => 100755 tools/Makefile create mode 100755 tools/logos/syteco.bmp
MAINTAINERS +3 -0
@@ -671,6 +671,9 @@ Sergey Lapin <[email protected]> afeb9260 ARM926EJS (AT91SAM9260 SoC) +Matthias Weisser <[email protected]> + + jadecpu ARM926EJS (MB86R01 'Jade' SoC) ------------------------------------------------------------------------- Unknown / orphaned boards:
MAKEALL +1 -0
@@ -533,6 +533,7 @@ LIST_ARM9=" \ davinci_sffsdr \ davinci_sonata \ davinci_dm355evm \ + jadecpu \ " #########################################################################
Makefile +7 -0
@@ -2785,6 +2785,13 @@ at91sam9rlek_config : unconfig pm9263_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91 +######################################################################### +## ARM926EJ-S Systems from multiple vendors +######################################################################### + +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
@@ -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 +173 -0
173 lines not on this page · raw message
tools/Makefile +3 -0
@@ -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
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
PATCH 1/1 Added support for splash screen positioning adding by adding
In reply to Matthias WeisserDear Matthias,
Thanks for this patch, some comments however. Please use short patch subject, e.g. "[PATCH] Add support for splash screen positioning" is enough. And than please add more descriptive patch commit message above your "Signed-off-by" line. In this commit message you can shortly explain how it is done (e.g. what you mean with "adding by adding").
This is a new feature and also we should document it in the README where the original "splashimage" environment variable is documented. But if this feature will be documented, we also have to support it in other places, it is used in "common/lcd.c".
Also please see other comments below.
Quoted 13 lines · Matthias Weisser
Signed-off-by Matthias Weisser <[email protected]>--- drivers/video/cfb_console.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) mode change 100644 => 100755 drivers/video/cfb_console.cdrivers/video/cfb_console.c +0
-0
drivers/video/cfb_console.c void console_cursor (int state); · line 317
Quoted 5 lines
drivers/video/cfb_console.c +1
-1@@ -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 )
Here you added CONFIG_VIDEO_JADEGDC case. Please do this in your other patch where you add support for JADE GDC. This patch addresses extension of "splashimage" and should do only this logical change.
drivers/video/cfb_console.c static void *video_logo (void) · line 1192
Quoted 9 lines
drivers/video/cfb_console.c +2
-0#define SHORTSWAP32 (x) ( ((x) >> 16) | ((x) << 16) )#else #define SHORTSWAP32 (x) (x)@@ -1188,9 +1188,17 @@ static void *video_logo (void)ulong addr;if ((s =getenv ("splashimage" )) !=NULL ) { +int x =0 , y =0 ; +
----^^^^^^^^^^^^
please remove tabs in the empty line above.
drivers/video/cfb_console.c static void *video_logo (void) · line 1197
Quoted 6 lines
drivers/video/cfb_console.c +3
-1addr =simple_strtoul (s,NULL ,16 ); -if (video_display_bitmap (addr,0 ,0 ) ==0 ) { +if ((s =strchr (s,' ' )) !=NULL ) { + x =simple_strtoul (s +1 ,NULL ,0 ); +if ((s =strchr (s +1 ,' ' )) !=NULL )
------------------------------------------------------------^^^^ remove trailing white space here, please.
drivers/video/cfb_console.c static void *video_logo (void) · line 1200
Quoted 3 lines
drivers/video/cfb_console.c +3
-0+ y =simple_strtoul (s +1 ,NULL ,0 ); + } +
-----^^^^^^^^^^^
please remove tabs here, too.
drivers/video/cfb_console.c static void *video_logo (void) · line 1204
Quoted 4 lines
drivers/video/cfb_console.c +1
-0+if (video_display_bitmap (addr, x, y) ==0 ) {return ((void *) (video_fb_address)); } }
Please fix and resubmit, thanks!
Anatolij
PATCH 1/1 Add suport for the graphic controller included in the JADE SOC
In reply to Matthias WeisserDear Matthias,
Thanks for this patch! Please see some comments/issues below which we should resolve before committing the driver.
Quoted 12 lines · Matthias Weisser
Signed-off-by Matthias Weisser <[email protected]>--- drivers/video/jadegdc.c | 205 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 205 insertions(+), 0 deletions(-) create mode 100755 drivers/video/jadegdc.cdrivers/video/jadegdc.c new file +0
-0
drivers/video/jadegdc.c line 3
Quoted 3 lines
drivers/video/jadegdc.c new file +3
-0@@ -0,0 +1,205 @@ +/* +* (C) Copyright 2007 +* DENX Software Engineering, Anatolij Gustschin, agust at denx.de
Please use your copyright here, as this driver for JADE GDC is mostly your work.
drivers/video/jadegdc.c line 15
Quoted 12 lines
drivers/video/jadegdc.c new file +12
-0+* +* 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
-----------------------------------------------------------^^^^^ please replace tab by space here.
drivers/video/jadegdc.c line 25
Quoted 10 lines
drivers/video/jadegdc.c new file +10
-0+* 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
------------------------------------------------------------------^^^^^ and remove trailing white space here.
drivers/video/jadegdc.c line 26
Quoted 1 line
drivers/video/jadegdc.c new file +1
-0+* controller. Derived from mb862xx.c
same here, trailing white space in the line above, please remove.
drivers/video/jadegdc.c line 31
Quoted 5 lines
drivers/video/jadegdc.c new file +5
-0+*/ + +#include <common.h> + +#if defined(CONFIG_VIDEO_JADEGDC )
drop this ifdef and add "COBJS-$(CONFIG_VIDEO_JADEGDC) += jadegdc.o" line to drivers/video/Makefile instead.
drivers/video/jadegdc.c line 40
Quoted 9 lines
drivers/video/jadegdc.c new file +9
-0+ +#include <malloc.h> +#include <asm/io.h> +#include <video_fb.h> +#include "videomodes.h" + +#if defined(CONFIG_POST ) +#include <post.h> +#endif
I think, this CONFIG_POST ifdef is not needed here, please remove it. Or am I missing something?
Quoted 16 lines
drivers/video/jadegdc.c new file +16
-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 + +/* +* Graphic Device +*/ +GraphicDevice jadegdc; + +void *video_hw_init (void )
drivers/video/jadegdc.c line 66
Quoted 10 lines
drivers/video/jadegdc.c new file +10
-0+{ +GraphicDevice *pGD = (GraphicDevice *)&jadegdc; +struct ctfb_res_modes var_mode[2 ]; +unsigned long * vid; +unsigned long div; +unsigned long dspBase[2 ]; +char *penv; +int bpp; +int i, j; +
----^^^
please remove tab in the line above.
drivers/video/jadegdc.c line 68
Quoted 2 lines
drivers/video/jadegdc.c new file +2
-0+memset (pGD,0 ,sizeof (GraphicDevice)); +
same here, remove tab.
drivers/video/jadegdc.c line 71
Quoted 3 lines
drivers/video/jadegdc.c new file +3
-0+ dspBase[0 ] =GDC_DSP0_BASE ; + dspBase[1 ] =GDC_DSP1_BASE ; +
----^^^
same here.
drivers/video/jadegdc.c line 77
Quoted 6 lines
drivers/video/jadegdc.c new file +6
-0+/* Preliminary init of the onboard graphic controller, +retrieve base address */ +if ((pGD->frameAdrs =GDC_HOST_BASE ) ==0 ) { +printf ("Controller not found!\n" ); +return (NULL ); + }
please replace above 4 lines by
pGD->frameAdrs = GDC_HOST_BASE;
and for multi line comments we now use following style
/*
* Multi line
* comment
*/
please use it here too.
drivers/video/jadegdc.c line 85
Quoted 8 lines
drivers/video/jadegdc.c new file +8
-0+ + pGD->gdfIndex =GDF_15BIT_555RGB ; + pGD->gdfBytesPP =2 ; + + pGD->memSize =VIDEO_MEM_SIZE ; + pGD->frameAdrs =PHYS_SDRAM +PHYS_SDRAM_SIZE -VIDEO_MEM_SIZE ; + vid = (unsigned long *)pGD->frameAdrs; +
remove tabs in empty lines above, please.
drivers/video/jadegdc.c line 87
Quoted 2 lines
drivers/video/jadegdc.c new file +2
-0+for (i =0 ; i <2 ; i++) + {
please use the following coding style:
for (i = 0; i < 2; i++) {drivers/video/jadegdc.c line 94
Quoted 7 lines
drivers/video/jadegdc.c new file +7
-0+char varName[32 ]; +u32 dcm1, dcm2, dcm3; +u16 htp, hdp, hdb, hsp, vtr, vsp, vdp; +u8 hsw, vsw; +u32 l2m, l2em, l2oa0, l2da0, l2oa1, l2da1; +u16 l2dx, l2dy, l2wx, l2wy, l2ww, l2wh; +
-----^^^^^^^^^^^^
tabs again, please drop.
drivers/video/jadegdc.c line 95
Quoted 1 line
drivers/video/jadegdc.c new file +1
-0+sprintf (varName,"gs_dsp_%d_param" , i);
please add a space between function name and open parenthesis as you seem to use this style in other places too. Use either
function (...); or function(...);
style throughout the file an do not intermix.
drivers/video/jadegdc.c line 99
Quoted 4 lines
drivers/video/jadegdc.c new file +4
-0+ +if (NULL == (penv =getenv (varName))) +if (NULL == (penv =getenv ("videomode" ))) +continue ;
please add a space between if and open parenthesis and remove tabs in the line above if statement.
drivers/video/jadegdc.c line 103
Quoted 4 lines
drivers/video/jadegdc.c new file +4
-0+ + bpp =0 ; + bpp =video_get_params (&var_mode[i], penv); +
------^^^
please remove.
drivers/video/jadegdc.c line 104
Quoted 1 line
drivers/video/jadegdc.c new file +1
-0+if (0 == bpp){
if (bpp == 0) {
drivers/video/jadegdc.c line 117
Quoted 13 lines
drivers/video/jadegdc.c new file +13
-0+ var_mode[i].xres =640 ; + var_mode[i].yres =480 ; + var_mode[i].pixclock =39721 ;/* 25MHz */ + var_mode[i].left_margin =48 ; + var_mode[i].right_margin =16 ; + var_mode[i].upper_margin =33 ; + var_mode[i].lower_margin =10 ; + var_mode[i].hsync_len =96 ; + var_mode[i].vsync_len =2 ; + var_mode[i].sync =0 ; + var_mode[i].vmode =0 ; + } +
------^^^^^
please remove.
drivers/video/jadegdc.c line 121
Quoted 4 lines
drivers/video/jadegdc.c new file +4
-0+for (j =0 ; j < var_mode[i].xres * var_mode[i].yres /2 ; j++) + { + *vid++ =0xFFFFFFFF ; + }
fix the coding style here, please:
for (...)
one line statement;
for (...) {
statement1;
statement2;
...
}drivers/video/jadegdc.c line 122
Quoted 1 line
drivers/video/jadegdc.c new file +1
-0+
tabs here, too, please check for tabs in empty lines throughout the file and remove them.
drivers/video/jadegdc.c line 129
Quoted 7 lines
drivers/video/jadegdc.c new file +7
-0+ pGD->winSizeX = var_mode[i].xres; + pGD->winSizeY = var_mode[i].yres; + +/* LCD base clock is ~ 660MHZ. We do calculations in kHz */ + div =660000 / (1000000000L / var_mode[i].pixclock); +if (div >64 ) + div =64 ;
please add space between if and open parenthesis.
drivers/video/jadegdc.c line 135
Quoted 6 lines
drivers/video/jadegdc.c new file +6
-0+ + dcm1 = div <<8 ; + dcm2 =0x00000000 ; + dcm3 =0x00000000 ; + + htp = var_mode[i].left_margin + var_mode[i].xres + var_mode[i].hsync_len + var_mode[i].right_margin;
line to long, max. 80 chars allowed.
drivers/video/jadegdc.c line 142
Quoted 7 lines
drivers/video/jadegdc.c new file +7
-0+ hdp = var_mode[i].xres; + hdb = var_mode[i].xres; + hsp = var_mode[i].xres + var_mode[i].right_margin; + hsw = var_mode[i].hsync_len; + + vsw = var_mode[i].vsync_len; + vtr = var_mode[i].upper_margin + var_mode[i].yres + var_mode[i].vsync_len + var_mode[i].lower_margin;
here too.
drivers/video/jadegdc.c line 144
Quoted 2 lines
drivers/video/jadegdc.c new file +2
-0+ vsp = var_mode[i].yres + var_mode[i].lower_margin; + vdp = var_mode[i].yres;
remove trailing white space in the line above.
drivers/video/jadegdc.c line 150
Quoted 6 lines
drivers/video/jadegdc.c new file +6
-0+ + l2m = ( (var_mode[i].yres-1 ) << (0 )) | + (((var_mode[i].xres *2 )/64 ) << (16 )) | + ( (1 ) << (31 )); + + l2em = (1 <<0 ) | (1 <<1 );
please add spaces around "<<", "-", "/" in the lines above. Also use this coding style elsewhere in the file.
drivers/video/jadegdc.c line 159
Quoted 9 lines
drivers/video/jadegdc.c new file +9
-0+ + l2oa0 = pGD->frameAdrs; + l2da0 = pGD->frameAdrs; + l2oa1 = pGD->frameAdrs; + l2da1 = pGD->frameAdrs; + l2dx =0 ; + l2dy =0 ; + l2wx =0 ; + l2wy =0 ;
trailing white space in 4 lines above, please remove.
drivers/video/jadegdc.c line 167
Quoted 8 lines
drivers/video/jadegdc.c new file +8
-0+ l2ww = var_mode[i].xres; + l2wh = var_mode[i].yres -1 ; + +writel (dcm1, dspBase[i] +0x100 ); +writel (dcm2, dspBase[i] +0x104 ); +writel (dcm3, dspBase[i] +0x108 ); + +writew (htp, dspBase[i] +0x006 );
trailing white space in the line above.
Quoted 23 lines
drivers/video/jadegdc.c new file +23
-0+writew (hdp, dspBase[i] +0x008 ); +writew (hdb, dspBase[i] +0x00A ); +writew (hsp, dspBase[i] +0x00C ); +writeb (hsw, dspBase[i] +0x00E ); + +writeb (vsw, dspBase[i] +0x00F ); +writew (vtr, dspBase[i] +0x012 ); +writew (vsp, dspBase[i] +0x014 ); +writew (vdp, dspBase[i] +0x016 ); + +writel ( l2m, dspBase[i] +0x040 ); +writel ( l2em, dspBase[i] +0x130 ); +writel (l2oa0, dspBase[i] +0x044 ); +writel (l2da0, dspBase[i] +0x048 ); +writel (l2oa1, dspBase[i] +0x04C ); +writel (l2da1, dspBase[i] +0x050 ); +writew ( l2dx, dspBase[i] +0x054 ); +writew ( l2dy, dspBase[i] +0x056 ); +writew ( l2wx, dspBase[i] +0x134 ); +writew ( l2wy, dspBase[i] +0x136 ); +writew ( l2ww, dspBase[i] +0x138 ); +writew ( l2wh, dspBase[i] +0x13A ); +
drivers/video/jadegdc.c line 200
Quoted 10 lines
drivers/video/jadegdc.c new file +10
-0+writel (dcm1 | (1 <<18 ) | (1 <<31 ), dspBase[i] +0x100 ); + } + +return pGD; +} + +/* +* Set a RGB color in the LUT +*/ +void video_set_lut (unsigned int index,unsigned char r,unsigned char g,unsigned char b)
line too long, please fix.
drivers/video/jadegdc.c line 205
Quoted 5 lines
drivers/video/jadegdc.c new file +5
-0+{ + +} + +#endif /* CONFIG_VIDEO_JADEGDC */
We also should use macros for register offsets, I think. Can we coordinate efforts for fixing this in mb862xx driver also? I know that mb862xx driver has similar style issues and I'm willing to fix them soon. For new patches the policy is to resolve issues before inclusion.
Thanks,
Anatolij
[U-Boot] Antw: Re: [PATCH] Add suport for the graphic controller included in the JADE SOC
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Anatolij Gustschin <[email protected]> schrieb am 01.07.2009 um 15:40:
Dear Matthias,
Thanks for this patch! Please see some comments/issues below which
we
Quoted 1 line
should resolve before committing the driver.
First of all thanks for your detailed comments. I fix them all before resending the patch. Please see some additional comments at some points.
Quoted 3 lines
drivers/video/jadegdc.c line 104
Quoted 1 line
drivers/video/jadegdc.c new file +1
-0+if (0 == bpp){if (bpp == 0) {
The spaces are OK but why turn around the comparison? I always use this style to prevent from unwanted assignments. Well, GCC warns about assignments in ifs and as u-boot is GCC only I can do that.
Quoted 2 lines
We also should use macros for register offsets, I think. Can we coordinate efforts for fixing this in mb862xx driver also?
As the graphic controller in the jade soc is only a slight evolution of
the coral graphic chip (additional display output/video input) I think
we may even merge the two drivers into one with some #ifdefs to deal with the differences.
When I started to implement the driver I decided against that idea because I don't have any hardware here to test the "non-jade" case.
But a common include file with the register offsets seems to be a good idea to me.
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
------------------------------------
PATCH 1/1 Add suport for the graphic controller included in the JADE SOC
Quoted 11 lines · Matthias Weisser
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Anatolij Gustschin <[email protected]> schrieb am 01.07.2009 um 15:40:
Dear Matthias,
Thanks for this patch! Please see some comments/issues below which
we
Quoted 1 line
should resolve before committing the driver.
First of all thanks for your detailed comments. I fix them all before resending the patch. Please see some additional comments at some points.
Quoted 6 lines
Quoted 2 lines
drivers/video/jadegdc.c line 104
Quoted 1 line
drivers/video/jadegdc.c new file +1
-0+if (0 == bpp){if (bpp == 0) {
The spaces are OK but why turn around the comparison? I always use this style to prevent from unwanted assignments. Well, GCC warns about assignments in ifs and as u-boot is GCC only I can do that.
it is a matter of personal preference. "if (0 == bpp) {" is OK for me, too.
Quoted 7 lines
Quoted 2 lines
We also should use macros for register offsets, I think. Can we coordinate efforts for fixing this in mb862xx driver also?
As the graphic controller in the jade soc is only a slight evolution of
the coral graphic chip (additional display output/video input) I think
Quoted 5 lines
we may even merge the two drivers into one with some #ifdefs to deal with the differences.
When I started to implement the driver I decided against that idea because I don't have any hardware here to test the "non-jade" case.
if you want to use the existing driver, it shouldn't be too complicated. To use the mb862xx driver you can implement "board_video_init()" in your board code in which you initialize both display controllers, set "GraphicDevice mb862xx" structure fields winSizeX, etc. and return the video RAM base. Then additionally implement "board_get_regs()" in your board code, e.g.
#include <mb862xx.h>
static const gdc_regs init_regs [] =
{
{0, 0}
}const gdc_regs *board_get_regs (void)
{
return init_regs;
}and define CONFIG_VIDEO_MB862xx in the board config file.
see e.g. the appropriate code in "board/lwmon5/lwmon5.c". It does the display controller initialization differently and therefore my suggestion to do the display controller init in custom "board_video_init()".
We have to fix some register access macros in the mb862xx driver for JADE and it should work. I can try to provide a patch for this fix in mb862xx.c.
Quoted 2 lines
But a common include file with the register offsets seems to be a good idea to me.
I'will prepare a list of register offset defines for "include/mb862xx.h" and send a patch so that you can use them in your code.
Thanks,
Anatolij
PATCH 1/1 Add suport for the graphic controller included in the JADE SOC
Dear Anatolij & Matthias,
Quoted 5 lines · in message <[email protected]> you wrote:
Quoted 5 lines
Quoted 3 lines
drivers/video/jadegdc.c line 104
Quoted 2 lines
drivers/video/jadegdc.c new file +1
-0+if (0 == bpp){if (bpp == 0) {
The spaces are OK but why turn around the comparison? I always use
Because "0 == bpp" is ugly.
Quoted 5 lines
Quoted 2 lines
this style to prevent from unwanted assignments. Well, GCC warns about assignments in ifs and as u-boot is GCC only I can do that.
it is a matter of personal preference. "if (0 == bpp) {" is OK for me, too.
NAK for me. Matthias, please do as Anatolij suggested.
Best regards,
Wolfgang Denk
Signature · 7 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 If a packet hits a pocket on a socket on a port, And the bus is interrupted as a very last resort, And the address of the memory makes your floppy disk abort, Then the socket packet pocket has an error to report! - Ken Burchill?
PATCH 1/1 Add suport for the graphic controller included in the JADE SOC
In reply to Anatolij GustschinQuoted 5 lines · Anatolij Gustschin
Quoted 2 lines
But a common include file with the register offsets seems to be a good idea to me.
I'will prepare a list of register offset defines for "
include/mb862xx.h" and send a patch so that you can use them in your code.
now the patch is out:
http://lists.denx.de/pipermail/u-boot/2009-July/055582.html
you can use the register offsets from "include/mb862xx.h" in your code for JADE SOC.
Thanks,
Anatolij
Wolfgang Denk
NAKPATCH 1/1 This patch adds support for Fujitsu MB86R01 'JADE' SOC
In reply to Matthias WeisserDear Matthias Weisser,
Quoted 11 lines · In message <[email protected]>…
Signed-off-by Matthias Weisser <[email protected]>--- cpu/arm926ejs/jade/Makefile | 47 +++++++++ cpu/arm926ejs/jade/timer.c | 129 ++++++++++++++++++++++++ include/asm-arm/arch-jade/hardware.h | 31 ++++++ include/asm-arm/arch-jade/jade.h | 182 ++++++++++++++++++++++++++++++++++ 4 files changed, 389 insertions(+), 0 deletions(-) create mode 100755 cpu/arm926ejs/jade/Makefile create mode 100755 cpu/arm926ejs/jade/timer.c create mode 100755 include/asm-arm/arch-jade/hardware.h create mode 100755 include/asm-arm/arch-jade/jade.h
Entries to MAKEALL and MAINTAINERS are missing.
Quoted 5 lines
include/asm-arm/arch-jade/jade.h new file +0
-0
...
Quoted 1 line
+typedef volatile unsigned int JREG; /* Hardware register definition */
You don't need this. We don't use register accesses, but I/O accessor functions.
Quoted 28 lines
include/asm-arm/arch-jade/jade.h new file +28
-0+/* +* Physical Address Defines +*/ +#define JADE_GDC_PHYS_BASE 0xf1fc0000/* GDC phys */ +#define JADE_GDC_PHYS_DISP_BASE 0xf1fd0000/* GDC DisplayBase phys */ +#define JADE_CCNT_PHYS_BASE 0xfff42000/* Chip Control Module */ +#define JADE_CAN0_PHYS_BASE 0xfff54000/* CAN 0 phys */ +#define JADE_CAN1_PHYS_BASE 0xfff55000/* CAN 1 phys */ +#define JADE_I2C0_PHYS_BASE 0xfff56000/* I2C 0 phys */ +#define JADE_I2C1_PHYS_BASE 0xfff57000/* I2C 1 phys */ +#define JADE_EHCI_PHYS_BASE 0xfff80000/* EHCI phys */ +#define JADE_OHCI_PHYS_BASE 0xfff81000/* OHCI phys */ +#define JADE_IRC1_PHYS_BASE 0xfffb0000/* Jade cascaded Interrupt Controller phys */ +#define JADE_TIMER_PHYS_BASE 0xfffe0000/* Counter/Timers JADE phys */ +#define JADE_UART0_PHYS_BASE 0xfffe1000/* UART 0 phys */ +#define JADE_UART1_PHYS_BASE 0xfffe2000/* UART 1 phys */ +#define JADE_IRCE_PHYS_BASE 0xfffe4000/* Extended Interrupt Controller */ +#define JADE_CRG_PHYS_BASE 0xfffe7000/* Clock Reset Generator */ +#define JADE_IRC0_PHYS_BASE 0xfffe8000/* Jade Interrupt Controller phys */ +#define JADE_GPIO_PHYS_BASE 0xfffe9000/* GPIO phys */ + + +/* -------- DRAMC_DRIC : (DRAMC Offset: 0x0) DRAM Controller Mode Register -------- */ + +/******************************************************************************** +* REGISTER ADDRESS DEFINITION FOR DRAMC PERIPHERAL * +********************************************************************************/ +#define JREGC_DRAMC_DRIC ((JREG *) 0xF3000000)/* DRAM Controller Initialization control register */
include/asm-arm/arch-jade/jade.h line 73
Quoted 10 lines
include/asm-arm/arch-jade/jade.h new file +10
-0+#define JREGC_DRAMC_DRIC1 ((JREG *) 0xF3000002)/* DRAM Controller Init control command register 1 */ +#define JREGC_DRAMC_DRIC2 ((JREG *) 0xF3000004)/* DRAM Controller Init control command register 2 */ +#define JREGC_DRAMC_DRCA ((JREG *) 0xF3000006)/* DRAM Controller Address control register */ +#define JREGC_DRAMC_DRCM ((JREG *) 0xF3000008)/* DRAM Controller Modal control register */ +#define JREGC_DRAMC_DRCST1 ((JREG *) 0xF300000A)/* DRAM Controller Timing setting register 1 */ +#define JREGC_DRAMC_DRCST2 ((JREG *) 0xF300000C)/* DRAM Controller Timing setting register 2 */ +#define JREGC_DRAMC_DRCR ((JREG *) 0xF300000E)/* DRAM Controller Refresh control register */ +#define JREGC_DRAMC_DRCS ((JREG *) 0xF3000020)/* DRAM Controller Status control register */ +#define JREGC_DRAMC_DRASR ((JREG *) 0xF3000030)/* DRAM Controller AXI operation setting register */ +#define JREGC_DRAMC_DRIMS1 ((JREG *) 0xF3000042)/* DRAM Controller IF control register 1 */
...
NAK.
We don't allow such a base address + offset approach.
Please define C structs for the peripherals, and use I/O accessors.
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: wd at denx.de All these theories, diverse as they are, have two things in common: they explain the observed facts, and they are completeley and utterly wrong. - Terry Pratchett, _The Light Fantastic_