From ac331da07db3860f11fa1d0fd3db7c810bce1198 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Thu, 17 Jan 2008 15:53:52 +0900 Subject: sh: Update SuperH SCIF driver This patch fixed wrong SH7720 CPU macro and changed macro that calculated value of SCBRR register. Signed-off-by: Nobuhiro Iwamatsu --- drivers/serial/serial_sh.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/drivers/serial/serial_sh.c b/drivers/serial/serial_sh.c index 00a9b39..70fd23f 100644 --- a/drivers/serial/serial_sh.c +++ b/drivers/serial/serial_sh.c @@ -1,6 +1,6 @@ /* * SuperH SCIF device driver. - * Copyright (c) 2007 Nobuhiro Iwamatsu + * Copyright (c) 2007,2008 Nobuhiro Iwamatsu * * 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 @@ -36,7 +36,7 @@ #define SCSCR (vu_short *)(SCIF_BASE + 0x8) #define SCFCR (vu_short *)(SCIF_BASE + 0x18) #define SCFDR (vu_short *)(SCIF_BASE + 0x1C) -#ifdef CONFIG_SH7720 /* SH7720 specific */ +#ifdef CONFIG_CPU_SH7720 /* SH7720 specific */ #define SCFSR (vu_short *)(SCIF_BASE + 0x14) /* SCSSR */ #define SCFTDR (vu_char *)(SCIF_BASE + 0x20) #define SCFRDR (vu_char *)(SCIF_BASE + 0x24) @@ -57,12 +57,19 @@ #define SCLSR (vu_short *)(SCIF_BASE + 0x24) #define LSR_ORER 1 #elif defined (CONFIG_SH3) -#ifdef CONFIG_SH7720 /* SH7720 specific */ -# define SCLSR SCFSR /* SCSSR */ +#ifdef CONFIG_CPU_SH7720 /* SH7720 specific */ +#define SCLSR (vu_short *)(SCIF_BASE + 0x24) +#define LSR_ORER 0x0200 #else -# define SCLSR (vu_short *)(SCIF_BASE + 0x24) +#define SCLSR SCFSR /* SCSSR */ +#define LSR_ORER 1 #endif -#define LSR_ORER 0x0200 +#endif + +#if defined(CONFIG_CPU_SH7720) +#define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(32*bps)-1) +#else /* Generic SuperH */ +#define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(32*bps)-1) #endif #define SCR_RE (1 << 4) @@ -82,18 +89,7 @@ void serial_setbrg (void) { DECLARE_GLOBAL_DATA_PTR; - -#if defined(CONFIG_CPU_SH7720) - int divisor = gd->baudrate * 16; - - *SCBRR = (CONFIG_SYS_CLK_FREQ * 2 + (divisor / 2)) / - (gd->baudrate * 32) - 1; -#else - int divisor = gd->baudrate * 32; - - *SCBRR = (CONFIG_SYS_CLK_FREQ + (divisor / 2)) / - (gd->baudrate * 32) - 1; -#endif + *SCBRR = SCBRR_VALUE(gd->baudrate,CONFIG_SYS_CLK_FREQ); } int serial_init (void) -- cgit v1.1 From 55ed1516cbc1dad3ae277c67ee06fc4a46eaac7d Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Thu, 17 Jan 2008 18:07:32 +0900 Subject: sh: Remove CONFIG_COMMANDS from MS7720SE config file Signed-off-by: Nobuhiro Iwamatsu --- include/configs/ms7720se.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/include/configs/ms7720se.h b/include/configs/ms7720se.h index 8a94c28..7035002 100644 --- a/include/configs/ms7720se.h +++ b/include/configs/ms7720se.h @@ -40,13 +40,6 @@ #define CONFIG_CMD_IDE #define CONFIG_CMD_EXT2 -#define CFG_CMD_PCMCIA 0x01 -#define CFG_CMD_IDE 0x02 - -#define CONFIG_COMMANDS ((CONFIG_CMD_DFL | \ - CFG_CMD_IDE|CFG_CMD_PCMCIA) & \ - ~(CFG_CMD_FPGA)) - #define CONFIG_BAUDRATE 115200 #define CONFIG_BOOTARGS "console=ttySC0,115200" #define CONFIG_BOOTFILE /boot/zImage -- cgit v1.1