From: Brian Cavagnolo Date: Tue, 1 Jun 2010 11:42:30 -0700 Subject: [U-Boot] [PATCH 3/3] add support for pollux-based leapfrog didj In-Reply-To: <1275417750-10020-2-git-send-email-brian@cozybit.com> References: <1275417750-10020-1-git-send-email-brian@cozybit.com> <1275417750-10020-2-git-send-email-brian@cozybit.com> Message-ID: <1275417750-10020-3-git-send-email-brian@cozybit.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Signed-off-by: Brian Cavagnolo Signed-off-by: Andrey Yurovsky --- Makefile | 7 +++ board/didj/Makefile | 54 ++++++++++++++++++++++++ board/didj/config.mk | 1 + board/didj/didj.c | 107 ++++++++++++++++++++++++++++++++++++++++++++++++ include/configs/didj.h | 71 ++++++++++++++++++++++++++++++++ 5 files changed, 240 insertions(+), 0 deletions(-) create mode 100644 board/didj/Makefile create mode 100644 board/didj/config.mk create mode 100644 board/didj/didj.c create mode 100644 include/configs/didj.h diff --git a/Makefile b/Makefile index c26e491..04d47a6 100644 --- a/Makefile +++ b/Makefile @@ -3120,6 +3120,13 @@ voiceblue_config: unconfig @$(MKCONFIG) $(@:_config=) arm arm925t voiceblue ######################################################################### +# pollux Systems +######################################################################### + +didj_config : unconfig + @$(MKCONFIG) $(@:_config=) arm arm926ejs didj NULL pollux + +######################################################################### ## S3C44B0 Systems ######################################################################### diff --git a/board/didj/Makefile b/board/didj/Makefile new file mode 100644 index 0000000..d320e80 --- /dev/null +++ b/board/didj/Makefile @@ -0,0 +1,54 @@ +# (C) Copyright 2010 cozybit, Inc. +# Brian Cavagnolo +# +# Derived from versatile/Makefile: +# +# (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$(BOARD).a + +COBJS := didj.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak $(obj).depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/didj/config.mk b/board/didj/config.mk new file mode 100644 index 0000000..245816f --- /dev/null +++ b/board/didj/config.mk @@ -0,0 +1 @@ +TEXT_BASE = $(CONFIG_TEXT_BASE) diff --git a/board/didj/didj.c b/board/didj/didj.c new file mode 100644 index 0000000..35ba49b --- /dev/null +++ b/board/didj/didj.c @@ -0,0 +1,107 @@ +/* + * (C) Copyright 2010 cozybit, Inc. + * Brian Cavagnolo, + * + * (C) Copyright 2007 Leapfrog, Inc. + * Andrey Yurovsky" + * + * 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 +#include +#include +#include +#include +#include + +#if defined(CONFIG_SHOW_BOOT_PROGRESS) +void show_boot_progress(int progress) +{ + printf("Boot reached stage %d\n", progress); +} +#endif + +/* Desired PLL1 frequency for SDRAM and UART */ +#define PLL1_FREQ 147000000 + +/* UART clock divider calculated such that the default BRD of 1 corresponds to + * a baud rate of 115200bps. This is required by the serial driver. Note that + * we calculate the divider below with an extra bit of precision to ensure that + * we round to the most suitable divider value. + */ +#define DEFAULT_BRD 1 +#define UARTDIV ((((PLL1_FREQ<<1)/(115200*(DEFAULT_BRD + 1)*16)) + 1)>>1) + +int board_init (void) +{ + + unsigned long tmp; + + icache_enable(); + + /* Didj uses PLL0 for the CPU clock at 393216000 Hz */ + REG32(PLLSETREG0) = PLL_REG(801, 55, 0); + /* PLL1 (bus clock) 147000000 Hz */ + REG32(PLLSETREG1) = PLL_REG(196, 9, 2); + + /* set bus and cpu clock source and dividers */ + tmp = REG32(CLKMODEREG); + tmp &= ~((0x3< + * + * (C) Copyright 2007 Leapfrog, Inc. + * Kosta Demirev, kdemirev at yahoo.com + * + * 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 __CONFIG_H +#define __CONFIG_H + +#include +#include + +#define CONFIG_ARM926EJS + +/* didj has minimal support for now, so turn lots of stuff off */ +#define CONFIG_SYS_NO_FLASH +#define CONFIG_ENV_IS_NOWHERE +#define CONFIG_SKIP_RELOCATE_UBOOT +#define CONFIG_SKIP_LOWLEVEL_INIT + +/* memory layout */ +#define CONFIG_NR_DRAM_BANKS 1 +#define PHYS_SDRAM_1 0x00000000 +#define PHYS_SDRAM_1_SIZE 0x02000000 +#define CONFIG_SYS_GBL_DATA_SIZE 128 +#define CONFIG_ENV_SIZE 8192 +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128 * 1024) +#define CONFIG_STACKSIZE (128 * 1024) +#define CONFIG_TEXT_BASE 0x00100000 +#define CONFIG_SYS_LOAD_ADDR 0x00200000 + +/* timer and clock set up */ +#define CONFIG_SYS_HZ (384000000/256) +#define CONFIG_SYS_TIMERBASE TIMER0_BASE + +/* serial port configuration */ +#define CONFIG_POLLUX_SERIAL +#define CONFIG_CONSOLE_UART_BASE UART0_BASE +#define CONFIG_BAUDRATE 115200 +#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } + +/* console/printing setup */ +#define CONFIG_SYS_PROMPT "=> " +#define CONFIG_SYS_LONGHELP +#define CONFIG_SYS_CBSIZE 256 +#define CONFIG_SYS_PBSIZE \ + (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) +#define CONFIG_SYS_MAXARGS 16 + +/* SUBJECT TO AUDIT */ + +#define CONFIG_PL011_CLOCK 24000000 + +#endif /* __CONFIG_H */ -- 1.6.0.4