summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
Diffstat (limited to 'board')
-rw-r--r--board/icecube/icecube.c17
-rw-r--r--board/kup/kup4x/Makefile2
-rw-r--r--board/kup/kup4x/usb.c81
-rw-r--r--board/netphone/netphone.c8
-rw-r--r--board/netphone/phone_console.c20
5 files changed, 31 insertions, 97 deletions
diff --git a/board/icecube/icecube.c b/board/icecube/icecube.c
index 5a206c0..15def0c 100644
--- a/board/icecube/icecube.c
+++ b/board/icecube/icecube.c
@@ -42,7 +42,7 @@ static void sdram_start (int hi_addr)
/* unlock mode register */
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000000 | hi_addr_bit;
__asm__ volatile ("sync");
-
+
/* precharge all banks */
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_addr_bit;
__asm__ volatile ("sync");
@@ -68,7 +68,7 @@ static void sdram_start (int hi_addr)
/* set mode register */
*(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_MODE;
__asm__ volatile ("sync");
-
+
/* normal operation */
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | hi_addr_bit;
__asm__ volatile ("sync");
@@ -88,7 +88,7 @@ long int initdram (int board_type)
ulong dramsize2 = 0;
#ifndef CFG_RAMBOOT
ulong test1, test2;
-
+
/* setup SDRAM chip selects */
*(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001e;/* 2G at 0x0 */
*(vu_long *)MPC5XXX_SDRAM_CS1CFG = 0x80000000;/* disabled */
@@ -121,7 +121,7 @@ long int initdram (int board_type)
if (dramsize < (1 << 20)) {
dramsize = 0;
}
-
+
/* set SDRAM CS0 size according to the amount of RAM found */
if (dramsize > 0) {
*(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x13 + __builtin_ffs(dramsize >> 20) - 1;
@@ -129,7 +129,6 @@ long int initdram (int board_type)
*(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0; /* disabled */
}
-
/* let SDRAM CS1 start right after CS0 */
*(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize + 0x0000001e;/* 2G */
@@ -144,12 +143,12 @@ long int initdram (int board_type)
} else {
dramsize2 = test2;
}
-
+
/* memory smaller than 1MB is impossible */
if (dramsize2 < (1 << 20)) {
dramsize2 = 0;
}
-
+
/* set SDRAM CS1 size according to the amount of RAM found */
if (dramsize2 > 0) {
*(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize
@@ -188,7 +187,7 @@ long int initdram (int board_type)
ulong dramsize = 0;
#ifndef CFG_RAMBOOT
ulong test1, test2;
-
+
/* setup and enable SDRAM chip selects */
*(vu_long *)MPC5XXX_SDRAM_START = 0x00000000;
*(vu_long *)MPC5XXX_SDRAM_STOP = 0x0000ffff;/* 2G */
@@ -217,7 +216,7 @@ long int initdram (int board_type)
/* set SDRAM end address according to size */
*(vu_long *)MPC5XXX_SDRAM_STOP = ((dramsize - 1) >> 15);
-
+
#else /* CFG_RAMBOOT */
/* Retrieve amount of SDRAM available */
diff --git a/board/kup/kup4x/Makefile b/board/kup/kup4x/Makefile
index 3fed0f0..5732044 100644
--- a/board/kup/kup4x/Makefile
+++ b/board/kup/kup4x/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
LIB = lib$(BOARD).a
-OBJS = $(BOARD).o ../common/flash.o ../common/kup.o usb.o
+OBJS = $(BOARD).o ../common/flash.o ../common/kup.o
$(LIB): .depend $(OBJS)
$(AR) crv $@ $(OBJS)
diff --git a/board/kup/kup4x/usb.c b/board/kup/kup4x/usb.c
deleted file mode 100644
index 5444008..0000000
--- a/board/kup/kup4x/usb.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * (C) Copyright 2004
- * Klaus Heydeck, Kieback & Peter GmbH & Co KG, heydeck@kieback-peter.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 <common.h>
-#include <mpc8xx.h>
-#include "../common/kup.h"
-
-
-#define SL811_ADR (0x50000000)
-#define SL811_DAT (0x50000001)
-
-
-static void sl811_write_index_data (__u8 index, __u8 data)
-{
- *(volatile unsigned char *) (SL811_ADR) = index;
- __asm__ ("eieio");
- *(volatile unsigned char *) (SL811_DAT) = data;
- __asm__ ("eieio");
-}
-
-static __u8 sl811_read_index_data (__u8 index)
-{
- __u8 data;
-
- *(volatile unsigned char *) (SL811_ADR) = index;
- __asm__ ("eieio");
- data = *(volatile unsigned char *) (SL811_DAT);
- __asm__ ("eieio");
- return (data);
-}
-
-int usb_init_kup4x (void)
-{
- volatile immap_t *immap = (immap_t *) CFG_IMMR;
- volatile memctl8xx_t *memctl = &immap->im_memctl;
- int i;
- unsigned char tmp;
-
- memctl = &immap->im_memctl;
- memctl->memc_or7 = 0xFFFF8726;
- memctl->memc_br7 = 0x50000401; /* start at 0x50000000 */
- /* BP 14 low = USB ON */
- immap->im_cpm.cp_pbdat &= ~(BP_USB_VCC);
- /* PB 14 nomal port */
- immap->im_cpm.cp_pbpar &= ~(BP_USB_VCC);
- /* output */
- immap->im_cpm.cp_pbdir |= (BP_USB_VCC);
-
- puts ("USB: ");
-
- for (i = 0x10; i < 0xff; i++) {
- sl811_write_index_data (i, i);
- tmp = (sl811_read_index_data (i));
- if (tmp != i) {
- printf ("SL811 compare error index=0x%02x read=0x%02x\n", i, tmp);
- return (-1);
- }
- }
- printf ("SL811 ready\n");
- return (0);
-}
diff --git a/board/netphone/netphone.c b/board/netphone/netphone.c
index 91943c9..698115a 100644
--- a/board/netphone/netphone.c
+++ b/board/netphone/netphone.c
@@ -30,6 +30,7 @@
#include <common.h>
#include <miiphy.h>
#include <sed156x.h>
+#include <status_led.h>
#include "mpc8xx.h"
@@ -659,6 +660,7 @@ int overwrite_console(void)
extern int drv_phone_init(void);
extern int drv_phone_use_me(void);
+extern int drv_phone_is_idle(void);
int misc_init_r(void)
{
@@ -691,6 +693,12 @@ int last_stage_init(void)
do_poll();
if (drv_phone_use_me()) {
+ status_led_set(0, STATUS_LED_ON);
+ while (!drv_phone_is_idle()) {
+ do_poll();
+ udelay(1000000 / CFG_HZ);
+ }
+
console_assign(stdin, "phone");
console_assign(stdout, "phone");
console_assign(stderr, "phone");
diff --git a/board/netphone/phone_console.c b/board/netphone/phone_console.c
index a0485b0..c6a59af 100644
--- a/board/netphone/phone_console.c
+++ b/board/netphone/phone_console.c
@@ -179,7 +179,6 @@ static int last_input_mode;
static int refresh_time;
static int blink_time;
static char last_fast_punct;
-static int last_tab_indicator = -1;
/*************************************************************************************************/
@@ -239,8 +238,6 @@ static void console_init(void)
refresh_time = REFRESH_HZ;
blink_time = BLINK_HZ;
- tab_indicator = 1;
-
memset(vty_buf, ' ', sizeof(vty_buf));
memset(last_visible_buf, ' ', sizeof(last_visible_buf));
@@ -253,6 +250,8 @@ static void console_init(void)
sed156x_init();
width = sed156x_text_width;
height = sed156x_text_height - 1;
+
+ tab_indicator = 0;
}
/*****************************************************************************/
@@ -718,8 +717,10 @@ static void update(void)
if (input_mode != last_input_mode)
sed156x_output_at(sed156x_text_width - 3, sed156x_text_height - 1, input_mode_txt[input_mode], 3);
- if (tab_indicator != last_tab_indicator)
+ if (tab_indicator == 0) {
sed156x_output_at(0, sed156x_text_height - 1, "\\t", 2);
+ tab_indicator = 1;
+ }
if (fast_punct != last_fast_punct)
sed156x_output_at(4, sed156x_text_height - 1, &fast_punct, 1);
@@ -779,7 +780,6 @@ static void update(void)
last_input_mode = input_mode;
last_fast_punct = fast_punct;
- last_tab_indicator = tab_indicator;
}
/* ensure visibility; the trick is to minimize the screen movement */
@@ -891,7 +891,8 @@ void phone_putc(const char c)
blink_time = BLINK_HZ;
switch (c) {
- case 13: /* ignore */
+ case '\a': /* ignore bell */
+ case '\r': /* ignore carriage return */
break;
case '\n': /* next line */
@@ -1141,3 +1142,10 @@ static void kp_do_poll(void)
break;
}
}
+
+/**************************************************************************************/
+
+int drv_phone_is_idle(void)
+{
+ return kp_state == SCAN;
+}