Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261261AbUKBXnD (ORCPT ); Tue, 2 Nov 2004 18:43:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262419AbUKBW5l (ORCPT ); Tue, 2 Nov 2004 17:57:41 -0500 Received: from phoenix.infradead.org ([81.187.226.98]:10247 "EHLO phoenix.infradead.org") by vger.kernel.org with ESMTP id S262691AbUKBWzE (ORCPT ); Tue, 2 Nov 2004 17:55:04 -0500 Date: Tue, 2 Nov 2004 22:55:01 +0000 From: Christoph Hellwig To: Mikael Starvik Cc: linux-kernel@vger.kernel.org, akpm@osdl.org Subject: Re: [PATCH 2/10] CRIS architecture update - Drivers Message-ID: <20041102225501.GA12890@infradead.org> Mail-Followup-To: Christoph Hellwig , Mikael Starvik , linux-kernel@vger.kernel.org, akpm@osdl.org References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-SRS-Rewrite: SMTP reverse-path rewritten from by phoenix.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 13237 Lines: 183 --0F1p//8PRICkK4MW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Any chance you could share code with drivers/char/ds1302.c so we don't have two almost identical copies of that driver? --0F1p//8PRICkK4MW Content-Type: application/octet-stream; name="cris269_2.patch" Content-Disposition: attachment; filename="cris269_2.patch" Content-Transfer-Encoding: quoted-printable diff -urNP --exclude=3D'*.cvsignore' ../linux/arch/cris/arch-v10/drivers/ax= isflashmap.c lx25/arch/cris/arch-v10/drivers/axisflashmap.c=0A--- ../linux/= arch/cris/arch-v10/drivers/axisflashmap.c Mon Oct 18 23:54:54 2004=0A+++ lx= 25/arch/cris/arch-v10/drivers/axisflashmap.c Mon Aug 16 14:37:22 2004=0A@@ = -11,6 +11,9 @@=0A * partition split defined below.=0A *=0A * $Log: axisf= lashmap.c,v $=0A+ * Revision 1.10 2004/08/16 12:37:22 starvik=0A+ * Merge= of Linux 2.6.8=0A+ *=0A * Revision 1.8 2004/05/14 07:58:03 starvik=0A = * Merge of changes from 2.4=0A *=0A@@ -153,6 +156,14 @@=0A #define FLASH_C= ACHED_ADDR KSEG_F=0A #endif=0A =0A+#if CONFIG_ETRAX_FLASH_BUSWIDTH=3D=3D= 1=0A+#define flash_data __u8=0A+#elif CONFIG_ETRAX_FLASH_BUSWIDTH=3D=3D2=0A= +#define flash_data __u16=0A+#elif CONFIG_ETRAX_FLASH_BUSWIDTH=3D=3D4=0A+#d= efine flash_data __u16=0A+#endif=0A+=0A /* From head.S */=0A extern unsigne= d long romfs_start, romfs_length, romfs_in_flash;=0A =0A@@ -161,19 +172,11 = @@=0A =0A /* Map driver functions. */=0A =0A-static __u8 flash_read8(struct= map_info *map, unsigned long ofs)=0A-{=0A- return *(__u8 *)(map->map_priv_= 1 + ofs);=0A-}=0A-=0A-static __u16 flash_read16(struct map_info *map, unsig= ned long ofs)=0A+static map_word flash_read(struct map_info *map, unsigned = long ofs)=0A {=0A- return *(__u16 *)(map->map_priv_1 + ofs);=0A-}=0A-=0A-st= atic __u32 flash_read32(struct map_info *map, unsigned long ofs)=0A-{=0A- r= eturn *(volatile unsigned int *)(map->map_priv_1 + ofs);=0A+ map_word tmp;= =0A+ tmp.x[0] =3D *(flash_data *)(map->map_priv_1 + ofs);=0A+ return tmp;= =0A }=0A =0A static void flash_copy_from(struct map_info *map, void *to,=0A= @@ -182,19 +185,9 @@=0A memcpy(to, (void *)(map->map_priv_1 + from), len);= =0A }=0A =0A-static void flash_write8(struct map_info *map, __u8 d, unsigne= d long adr)=0A-{=0A- *(__u8 *)(map->map_priv_1 + adr) =3D d;=0A-}=0A-=0A-st= atic void flash_write16(struct map_info *map, __u16 d, unsigned long adr)= =0A-{=0A- *(__u16 *)(map->map_priv_1 + adr) =3D d;=0A-}=0A-=0A-static void = flash_write32(struct map_info *map, __u32 d, unsigned long adr)=0A+static v= oid flash_write(struct map_info *map, map_word d, unsigned long adr)=0A {= =0A- *(__u32 *)(map->map_priv_1 + adr) =3D d;=0A+ *(flash_data *)(map->map_= priv_1 + adr) =3D (flash_data)d.x[0];=0A }=0A =0A /*=0A@@ -215,14 +208,10 @= @=0A static struct map_info map_cse0 =3D {=0A .name =3D "cse0",=0A .size = =3D MEM_CSE0_SIZE,=0A- .buswidth =3D CONFIG_ETRAX_FLASH_BUSWIDTH,=0A- .read= 8 =3D flash_read8,=0A- .read16 =3D flash_read16,=0A- .read32 =3D flash_read= 32,=0A+ .bankwidth =3D CONFIG_ETRAX_FLASH_BUSWIDTH,=0A+ .read =3D flash_rea= d,=0A .copy_from =3D flash_copy_from,=0A- .write8 =3D flash_write8,=0A- .w= rite16 =3D flash_write16,=0A- .write32 =3D flash_write32,=0A+ .write =3D fl= ash_write,=0A .map_priv_1 =3D FLASH_UNCACHED_ADDR=0A };=0A =0A@@ -235,14 += 224,10 @@=0A static struct map_info map_cse1 =3D {=0A .name =3D "cse1",=0A= .size =3D MEM_CSE1_SIZE,=0A- .buswidth =3D CONFIG_ETRAX_FLASH_BUSWIDTH,= =0A- .read8 =3D flash_read8,=0A- .read16 =3D flash_read16,=0A- .read32 =3D = flash_read32,=0A+ .bankwidth =3D CONFIG_ETRAX_FLASH_BUSWIDTH,=0A+ .read =3D= flash_read,=0A .copy_from =3D flash_copy_from,=0A- .write8 =3D flash_writ= e8,=0A- .write16 =3D flash_write16,=0A- .write32 =3D flash_write32,=0A+ .wr= ite =3D flash_write,=0A .map_priv_1 =3D FLASH_UNCACHED_ADDR + MEM_CSE0_SIZ= E=0A };=0A =0A=0Adiff -urNP --exclude=3D'*.cvsignore' ../linux/arch/cris/ar= ch-v10/drivers/ds1302.c lx25/arch/cris/arch-v10/drivers/ds1302.c=0A--- ../l= inux/arch/cris/arch-v10/drivers/ds1302.c Mon Oct 18 23:55:07 2004=0A+++ lx2= 5/arch/cris/arch-v10/drivers/ds1302.c Tue Aug 24 08:48:43 2004=0A@@ -7,6 +7= ,9 @@=0A *! Functions exported: ds1302_readreg, ds1302_writereg, ds1302_ini= t=0A *!=0A *! $Log: ds1302.c,v $=0A+*! Revision 1.14 2004/08/24 06:48:43 = starvik=0A+*! Whitespace cleanup=0A+*!=0A *! Revision 1.13 2004/05/28 09:2= 6:59 starvik=0A *! Modified I2C initialization to work in 2.6.=0A *!=0A@@ = -123,7 +126,7 @@=0A *!=0A *! (C) Copyright 1999, 2000, 2001 Axis Communica= tions AB, LUND, SWEDEN=0A *!=0A-*! $Id: ds1302.c,v 1.13 2004/05/28 09:26:59= starvik Exp $=0A+*! $Id: ds1302.c,v 1.14 2004/08/24 06:48:43 starvik Exp $= =0A *!=0A *!***************************************************************= ************/=0A =0Adiff -urNP --exclude=3D'*.cvsignore' ../linux/arch/cris= /arch-v10/drivers/gpio.c lx25/arch/cris/arch-v10/drivers/gpio.c=0A--- ../li= nux/arch/cris/arch-v10/drivers/gpio.c Mon Oct 18 23:53:06 2004=0A+++ lx25/a= rch/cris/arch-v10/drivers/gpio.c Tue Aug 24 09:19:59 2004=0A@@ -1,4 +1,4 @@= =0A-/* $Id: gpio.c,v 1.11 2004/05/14 07:58:03 starvik Exp $=0A+/* $Id: gpio= .c,v 1.12 2004/08/24 07:19:59 starvik Exp $=0A *=0A * Etrax general port = I/O device=0A *=0A@@ -9,6 +9,9 @@=0A * Johan Adolfsson (read= /set directions, write, port G)=0A *=0A * $Log: gpio.c,v $=0A+ * Revision= 1.12 2004/08/24 07:19:59 starvik=0A+ * Whitespace cleanup=0A+ *=0A * Re= vision 1.11 2004/05/14 07:58:03 starvik=0A * Merge of changes from 2.4= =0A *=0Adiff -urNP --exclude=3D'*.cvsignore' ../linux/arch/cris/arch-v10/d= rivers/i2c.c lx25/arch/cris/arch-v10/drivers/i2c.c=0A--- ../linux/arch/cris= /arch-v10/drivers/i2c.c Mon Oct 18 23:53:11 2004=0A+++ lx25/arch/cris/arch-= v10/drivers/i2c.c Tue Aug 24 08:49:14 2004=0A@@ -12,6 +12,12 @@=0A *! = don't use PB_I2C if DS1302 uses same bits,=0A *!= use PB.=0A *! $Log: i2c.c,v $=0A+*! Revisi= on 1.9 2004/08/24 06:49:14 starvik=0A+*! Whitespace cleanup=0A+*!=0A+*! R= evision 1.8 2004/06/08 08:48:26 starvik=0A+*! Removed unused code=0A+*!= =0A *! Revision 1.7 2004/05/28 09:26:59 starvik=0A *! Modified I2C initia= lization to work in 2.6.=0A *!=0A@@ -69,7 +75,7 @@=0A *! (C) Copyright 1999= -2002 Axis Communications AB, LUND, SWEDEN=0A *!=0A *!*********************= ******************************************************/=0A-/* $Id: i2c.c,v = 1.7 2004/05/28 09:26:59 starvik Exp $ */=0A+/* $Id: i2c.c,v 1.9 2004/08/24 = 06:49:14 starvik Exp $ */=0A =0A /****************** INCLUDE FILES SECTION = ***********************************/=0A =0A@@ -110,14 +116,6 @@=0A #define = I2C_DATA_HIGH 1=0A #define I2C_DATA_LOW 0=0A =0A-#if 0=0A-/* TODO: fix this= so the CONFIG_ETRAX_I2C_USES... is set in Config.in instead */=0A-#if defi= ned(CONFIG_DS1302) && (CONFIG_DS1302_SDABIT=3D=3D0) && \=0A- (CON= FIG_DS1302_SCLBIT =3D=3D 1)=0A-#define CONFIG_ETRAX_I2C_USES_PB_NOT_PB_I2C= =0A-#endif=0A-#endif=0A-=0A #ifdef CONFIG_ETRAX_I2C_USES_PB_NOT_PB_I2C=0A /= * Use PB and not PB_I2C */=0A #ifndef CONFIG_ETRAX_I2C_DATA_PORT=0A@@ -441,= 7 +439,7 @@=0A */=0A i2c_data(I2C_DATA_HIGH);=0A i2c_delay(CLOCK_LOW_TI= ME);=0A- =0A+=0A i2c_dir_in();=0A }=0A =0A@@ -472,7 +470,7 @@=0A i2c_dela= y(CLOCK_HIGH_TIME);=0A i2c_clk(I2C_CLOCK_LOW);=0A i2c_delay(CLOCK_LOW_TIM= E);=0A-=0A+ =0A i2c_dir_in();=0A }=0A =0Adiff -urNP --exclude=3D'*.cvsigno= re' ../linux/arch/cris/arch-v10/drivers/pcf8563.c lx25/arch/cris/arch-v10/d= rivers/pcf8563.c=0A--- ../linux/arch/cris/arch-v10/drivers/pcf8563.c Mon Oc= t 18 23:53:46 2004=0A+++ lx25/arch/cris/arch-v10/drivers/pcf8563.c Tue Aug = 24 08:42:51 2004=0A@@ -15,7 +15,7 @@=0A *=0A * Author: Tobias Anderberg <= tobiasa@axis.com>.=0A *=0A- * $Id: pcf8563.c,v 1.4 2004/05/28 09:26:59 sta= rvik Exp $=0A+ * $Id: pcf8563.c,v 1.8 2004/08/24 06:42:51 starvik Exp $=0A = */=0A =0A #include =0A@@ -40,7 +40,7 @@=0A #define PCF8563= _MAJOR 121 /* Local major number. */=0A #define DEVICE_NAME "rtc" /* Name= which is registered in /proc/devices. */=0A #define PCF8563_NAME "PCF8563"= =0A-#define DRIVER_VERSION "$Revision: 1.4 $"=0A+#define DRIVER_VERSION "$R= evision: 1.8 $"=0A =0A /* I2C bus slave registers. */=0A #define RTC_I2C_RE= AD 0xa3=0A@@ -295,7 +295,7 @@=0A return 0;=0A }=0A =0A-static int __init= =0A+static int __init =0A pcf8563_register(void)=0A {=0A pcf8563_init();= =0Adiff -urNP --exclude=3D'*.cvsignore' ../linux/arch/cris/arch-v10/drivers= /serial.c lx25/arch/cris/arch-v10/drivers/serial.c=0A--- ../linux/arch/cris= /arch-v10/drivers/serial.c Mon Oct 18 23:54:38 2004=0A+++ lx25/arch/cris/ar= ch-v10/drivers/serial.c Wed Sep 29 12:33:49 2004=0A@@ -1,4 +1,4 @@=0A-/* $I= d: serial.c,v 1.20 2004/05/24 12:00:20 starvik Exp $=0A+/* $Id: serial.c,v = 1.25 2004/09/29 10:33:49 starvik Exp $=0A *=0A * Serial port driver for t= he ETRAX 100LX chip=0A *=0A@@ -7,6 +7,20 @@=0A * Many, many authors. B= ased once upon a time on serial.c for 16x50.=0A *=0A * $Log: serial.c,v $= =0A+ * Revision 1.25 2004/09/29 10:33:49 starvik=0A+ * Resolved a dealock= when printing debug from kernel.=0A+ *=0A+ * Revision 1.24 2004/08/27 23:= 25:59 johana=0A+ * rs_set_termios() must call change_speed() if c_iflag ha= s changed or=0A+ * automatic XOFF handling will be enabled and transmitter = will stop=0A+ * if 0x13 is received.=0A+ *=0A+ * Revision 1.23 2004/08/24 = 06:57:13 starvik=0A+ * More whitespace cleanup=0A+ *=0A+ * Revision 1.22 = 2004/08/24 06:12:20 starvik=0A+ * Whitespace cleanup=0A+ *=0A * Revision = 1.20 2004/05/24 12:00:20 starvik=0A * Big merge of stuff from Linux 2.4 = (e.g. manual mode for the serial port).=0A *=0A@@ -409,7 +423,7 @@=0A *= =0A */=0A =0A-static char *serial_version =3D "$Revision: 1.20 $";=0A+stat= ic char *serial_version =3D "$Revision: 1.25 $";=0A =0A #include =0A #include =0A@@ -647,7 +661,7 @@=0A #ifdef CONFIG= _ETRAX_SERIAL_PORT3=0A | IO_MASK(R_IRQ_MASK1_RD, ser3_data) | IO_MASK(R_IRQ= _MASK1_RD, ser3_ready)=0A #endif=0A-;=0A+; =0A unsigned long r_alt_ser_baud= rate_shadow =3D 0;=0A =0A /* this is the data for the four serial ports in = the etrax100 */=0A@@ -2541,7 +2555,7 @@=0A DFLOW(DEBUG_LOG(info->line,"f= lush_to_flip throttles again! %lu\n", max_flip_size));=0A rs_throttle(tt= y);=0A }=0A-#endif=0A+#endif =0A }=0A =0A if (max_flip_size > TTY_FLIPB= UF_SIZE)=0A@@ -2560,7 +2574,7 @@=0A length +=3D count;=0A info->recv_cn= t -=3D count;=0A DFLIP(DEBUG_LOG(info->line,"flip: %i\n", length));=0A-= =0A+ =0A if (count =3D=3D buffer->length) {=0A info->first_recv_buffer= =3D buffer->next;=0A kfree(buffer);=0A@@ -3460,7 +3474,7 @@=0A u16 d= ivisor =3D info->custom_divisor;=0A /* R_SERIAL_PRESCALE (upper 16 bits = of R_CLOCK_PRESCALE) */=0A /* baudrate is 3.125MHz/custom_divisor */=0A-= alt_source =3D=0A+ alt_source =3D =0A IO_STATE(R_ALT_SER_BAUDRATE,= ser0_rec, prescale) |=0A IO_STATE(R_ALT_SER_BAUDRATE, ser0_tr, prescal= e);=0A alt_source =3D 0x11;=0A@@ -3684,7 +3698,7 @@=0A up(&tmp_buf_sem= );=0A } else {=0A cli(); =0A- while (1) {=0A+ while (count) {=0A c = =3D CIRC_SPACE_TO_END(info->xmit.head,=0A info->xmit.tail,=0A = SERIAL_XMIT_SIZE);=0A@@ -3980,12 +3994,12 @@=0A =0A if (info->co= unt > 1)=0A return -EBUSY;=0A- =0A+=0A /*=0A * OK, past this point, al= l the error checking has been done.=0A * At this point, we start making c= hanges.....=0A */=0A- =0A+=0A info->baud_base =3D new_serial.baud_base;= =0A info->flags =3D ((info->flags & ~ASYNC_FLAGS) |=0A (new_seria= l.flags & ASYNC_FLAGS));=0A@@ -4252,7 +4266,8 @@=0A {=0A struct e100_seria= l *info =3D (struct e100_serial *)tty->driver_data;=0A =0A- if (tty->termio= s->c_cflag =3D=3D old_termios->c_cflag)=0A+ if (tty->termios->c_cflag =3D= =3D old_termios->c_cflag &&=0A+ tty->termios->c_iflag =3D=3D old_termio= s->c_iflag)=0A return;=0A =0A change_speed(info);=0A@@ -4276,6 +4291,7 @= @=0A static int rs_debug_write_function(int i, const char *buf, unsigned in= t len)=0A {=0A int cnt;=0A+ int written =3D 0;=0A struct tty_struc= t *tty;=0A static int recurse_cnt =3D 0;=0A =0A@@ -4287,14 +4303,17= @@=0A =0A local_irq_save(flags);=0A recurse_cnt++;=0A+ local_irq_rest= ore(flags);=0A do {=0A- cnt =3D rs_w= rite(tty, 0, buf, len);=0A+ cnt =3D rs_write(tty, 0,= buf + written, len);=0A if (cnt >=3D 0) {=0A+ w= ritten +=3D cnt;=0A buf +=3D cnt;=0A = len -=3D cnt;=0A } else= =0A len =3D cnt;=0A } while= (len > 0);=0A+ local_irq_save(flags);=0A recurse_cnt--;=0A local_irq_r= estore(flags);=0A return 1;=0A --0F1p//8PRICkK4MW-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/