[U-Boot] [PATCH 3/3] add support for pollux-based leapfrog didj
Brian Cavagnolo
brian at cozybit.com
Tue Jun 1 20:42:30 CEST 2010
Signed-off-by: Brian Cavagnolo <brian at cozybit.com>
Signed-off-by: Andrey Yurovsky <yurovsky at gmail.com>
---
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 <brian at cozybit.com>
+#
+# 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, <brian at cozybit.com>
+ *
+ * (C) Copyright 2007 Leapfrog, Inc.
+ * Andrey Yurovsky" <yurovsky at gmail.com>
+ *
+ * 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/arch/clkpwr.h>
+#include <asm/arch/reg.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/timer.h>
+#include <asm/arch/uart.h>
+
+#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<<CLKSELCPU0)|
+ (0xF<<CLKDIVCPU0)|
+ (0xF<<CLKDIV2CPU0)|
+ (0x3<<CLKSELBCLK)|
+ (0xF<<CLKDIV1BCLK));
+ tmp |= ((0<<CLKSELCPU0)|
+ (0<<CLKDIVCPU0)|
+ (2<<CLKDIV2CPU0)|
+ (0<<CLKSELBCLK)|
+ (2<<CLKDIV1BCLK));
+ REG32(CLKMODEREG) = tmp;
+
+ /* apply settings */
+ BIT_SET(REG32(PWRMODE), CHGPLL);
+
+ /* wait for PLLs to stabalize */
+ while(IS_SET(REG32(PWRMODE), CHGPLL));
+
+ /* timer runs on PLL0 divided down by 256 */
+ REG32(CONFIG_SYS_TIMERBASE + TMRCLKGEN) |=
+ ((256-1)<<TCLKDIV)|(0<<TCLKSRCSEL);
+
+ /* UART0 pins can either be a UART or GPIO. We want UART. For this we
+ * must configure GPIOA, pin 8 to be the UART TX, which is it's
+ * alternative function.
+ */
+ tmp = REG32(GPIOAALTFN0);
+ tmp &= ~(ALTFN0_PIN_MASK(8));
+ tmp |= ALTFN0_PIN_CFG(8, GPIO_ALT1);
+ REG32(GPIOAALTFN0) = tmp;
+
+ /* UART0 runs on PLL1. */
+ REG32(UART0_BASE + UARTCLKGEN) =
+ ((1<<UARTCLKSRCSEL)|((UARTDIV - 1)<<UARTCLKDIV));
+
+ return 0;
+}
+
+int dram_init (void)
+{
+ return 0;
+}
diff --git a/include/configs/didj.h b/include/configs/didj.h
new file mode 100644
index 0000000..848e99d
--- /dev/null
+++ b/include/configs/didj.h
@@ -0,0 +1,71 @@
+/*
+ * (C) Copyright 2010 cozybit, Inc.
+ * Brian Cavagnolo <brian at cozybit.com>
+ *
+ * (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 <asm/arch/uart.h>
+#include <asm/arch/timer.h>
+
+#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
More information about the U-Boot
mailing list