Skip to contentSkip to conversation

AS352X SOC02:Part02 for U-boot1.1.6

PATCH New thomas.luo 1 participant 1 message Dec 5, 2006

lore
Share & tools
lore

thomas.luo

author
#0 lore raw

PATCH 1/1 AS352X SOC02:Part02 for U-boot1.1.6

U-Boot1.1.6 for AS352X
Port to U-boot to New ARM base SOC AS352X, support NAND flash Boot. please ref:
http://www.austriamicrosystems.com/03products/products_detail/AS3525/AS3525.htm
Part 2:
Br

Signed-off-by: Thomas Luothomas.luo at austriamicrosystems.com
--------------------------------------------------------------------------------------------------

cpu/arm922t/as352x/serial.c 2006-12-04 10:30:49.000000000 +0800 renamed from cpu/arm922t/as352x/serial.c 1970-01-01 08:00:00.000000000 +0800 +145 -0
diff -upBNr u-boot-1.1.6.org/cpu/arm922t/as352x/serial.c u-boot-1.1.6/cpu/arm922t/as352x/serial.c
@@ -0,0 +1,145 @@
+/*
+* Copyright (C) 2006 Austriamicrosystems Corporation
+*
+* 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>
+#if defined(CONFIG_AS352X)
+#include <as352x.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+* Initialise the serial port with the given baudrate. The settings
+* are always 8 data bits, no parity, 1 stop bit, no start bits.
+*/
+void serial_setbrg (void)
+{
+ u8 controlData;
+ set_reg_bits32(CCU_IO,CCU_IO_UART);
+
+ /* reset the uart
+ */
+ set_reg_bits32(CCU_SRC, CCU_SRC_UART0);
+ write_reg32(CCU_SRL, CCU_SRL_MAGIC_NUMBER);
+ clr_reg_bits32(CCU_SRC, CCU_SRC_UART0);
+ write_reg32(CCU_SRL, 0x0);
+ write_reg32(UART_FCTL_REG, 0);
+ write_reg32(UART_INTEN_REG, 0);
+ controlData = 3;
+ write_reg32(UART_LNCTL_REG,controlData| UART_LNCTL_DLSEN);
+ write_reg32(UART_DLO_REG,0x68);
+ write_reg32(UART_DHI_REG,0x0);
+ write_reg32(UART_LNCTL_REG,controlData& (~UART_LNCTL_DLSEN));
+
+}
+int serial_init (void)
+{
+ int i;
+ serial_setbrg();
+ for (i = 0; i < 100; i++);
+ return (0);
+}
+
+/*
+* Read a single byte from the serial port. Returns 1 on success, 0
+* otherwise. When the function is succesfull, the character read is
+* written into its argument c.
+*/
+int serial_getc (void)
+{
+ u8 c;
+
+ while (!(read_reg32(UART_LNSTATUS_REG) & UART_RX_DATA_READY));
+ c = read_reg32(UART_DATA_REG);
+ return c&0xff;
+}
+
+#ifdef CONFIG_HWFLOW
+static int hwflow = 0; /* turned off by default */
+int hwflow_onoff(int on)
+{
+ switch(on) {
+ case 0:
+ default:
+  break; /* return current */
+ case 1:
+  hwflow = 0; /* turn on */
+  break;
+ case -1:
+  hwflow = 0; /* turn off */
+  break;
+ }
+ return hwflow;
+}
+#endif
+
+#ifdef CONFIG_MODEM_SUPPORT
+static int be_quiet = 0;
+void disable_putc(void)
+{
+ be_quiet = 1;
+}
+
+void enable_putc(void)
+{
+ be_quiet = 0;
+}
+#endif
+
+
+/*
+* Output a single byte to the serial port.
+*/
+void serial_putc (const char c)
+{
+#ifdef CONFIG_MODEM_SUPPORT
+ if (be_quiet)
+  return;
+#endif
+
+ /* wait for room in the tx FIFO */
+ while (!(read_reg32(UART_LNSTATUS_REG) & UART_TX_HOLD_REG_EMPTY));
+ write_reg32(UART_DATA_REG,c);
+
+
+
+ /* If \n, also do \r */
+ if (c == '\n')
+  serial_putc ('\r');
+}
+
+/*
+* Test whether a character is in the RX buffer
+*/
+int serial_tstc (void)
+{
+ return (read_reg32(UART_LNSTATUS_REG) & UART_RX_DATA_READY);
+}
+
+void
+serial_puts (const char *s)
+{
+ while (*s) {
+  serial_putc (*s++);
+ }
+}
+
+#endif /* defined(CONFIG_AS352X)*/
cpu/arm922t/config.mk 2006-11-24 16:43:15.000000000 +0800 renamed from cpu/arm922t/config.mk 1970-01-01 08:00:00.000000000 +0800 +34 -0
diff -upBNr u-boot-1.1.6.org/cpu/arm922t/config.mk u-boot-1.1.6/cpu/arm922t/config.mk
@@ -0,0 +1,34 @@
+#
+# (C) Copyright 2002
+# Gary Jennejohn, DENX Software Engineering, <[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
+#
+
+PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8 \
+
+
+PLATFORM_CPPFLAGS += -march=armv4
+# =========================================================================
+#
+# Supply options according to compiler version
+#
+# =========================================================================
+PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
+PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
cpu/arm922t/cpu.c 2006-12-04 09:51:34.000000000 +0800 renamed from cpu/arm922t/cpu.c 1970-01-01 08:00:00.000000000 +0800 +194 -0

194 lines not on this page · raw message

cpu/arm922t/interrupts.c 2006-11-23 17:01:25.000000000 +0800 renamed from cpu/arm922t/interrupts.c 1970-01-01 08:00:00.000000000 +0800 +167 -0

167 lines not on this page · raw message

cpu/arm922t/Makefile 2006-11-02 22:15:02.000000000 +0800 renamed from cpu/arm922t/Makefile 1970-01-01 08:00:00.000000000 +0800 +47 -0

47 lines not on this page · raw message

cpu/arm922t/start.S 2006-11-30 10:25:41.000000000 +0800 renamed from cpu/arm922t/start.S 1970-01-01 08:00:00.000000000 +0800 +353 -0

353 lines not on this page · raw message

CREDITS 2006-12-04 10:20:27.000000000 +0800 renamed from CREDITS 2006-12-01 17:49:32.000000000 +0800 +5 -0
diff -upBNr u-boot-1.1.6.org/CREDITS u-boot-1.1.6/CREDITS
@@ -465,3 +465,8 @@ N: James MacAulay
 E: james.macaulay at amirix.com
 D: Suppport for Amirix AP1000
 W: www.amirix.com
+
+N: Thomas Luo
+E: thomas.luo at austriamicrosystems.com
+D: Port to ARM base SOC AS352X.
+W: www.austriamicrosystems.com
include/arm922t.h 2006-11-23 16:30:48.000000000 +0800 renamed from include/arm922t.h 1970-01-01 08:00:00.000000000 +0800 +12 -0
diff -upBNr u-boot-1.1.6.org/include/arm922t.h u-boot-1.1.6/include/arm922t.h
@@ -0,0 +1,12 @@
+/************************************************
+ * NAME     : arm922t.h
+ * Version  : 30 April 2002   *
+ *
+ * empty for now
+ ************************************************/
+
+#ifndef __ARM922T_H__
+#define __ARM922T_H__
+
+
+#endif /*__ARM922T_H__*/