On Wed, Aug 29, 2007 at 03:34:19PM +0200, Markus Boas wrote:
Index: w29ee011.c
--- w29ee011.c (Revision 0) +++ w29ee011.c (Revision 0) @@ -0,0 +1,51 @@ +/* +* C Implementation: w29ee011 +* +* Description: +* +* +* Author: Markus Boas ryven@ryven.de, (C) 2007 +* +* Copyright: See COPYING file that comes with this distribution +* +*/
Please drop the above and use the generic LinuxBIOS header as per http://linuxbios.org/Development_Guidelines#Common_License_Header
(yes, I know, the existing files are b0rked too, I'll fix that in a minute)
+#include "flash.h"
+int probe_w29ee011(struct flashchip *flash) +{
- volatile uint8_t *bios = flash->virtual_memory;
- uint8_t id1, id2;
- /* Issue JEDEC Product ID Entry command */
- *(volatile uint8_t *)(bios + 0x5555) = 0xAA;
- myusec_delay(10);
- *(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
- myusec_delay(10);
- *(volatile uint8_t *)(bios + 0x5555) = 0x80;
- myusec_delay(10);
- *(volatile uint8_t *)(bios + 0x5555) = 0xAA;
- myusec_delay(10);
- *(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
- myusec_delay(10);
- *(volatile uint8_t *)(bios + 0x5555) = 0x60;
- myusec_delay(10);
- /* Read product ID */
- id1 = *(volatile uint8_t *)bios;
- id2 = *(volatile uint8_t *)(bios + 0x01);
- /* Issue JEDEC Product ID Exit command */
- *(volatile uint8_t *)(bios + 0x5555) = 0xAA;
- myusec_delay(10);
- *(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
- myusec_delay(10);
- *(volatile uint8_t *)(bios + 0x5555) = 0xF0;
- myusec_delay(10);
- printf_debug("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2);
- if (id1 == flash->manufacture_id && id2 == flash->model_id)
return 1;
- return 0;
+}
Index: w29ee011.h
--- w29ee011.h (Revision 0) +++ w29ee011.h (Revision 0) @@ -0,0 +1,18 @@ +// +// C++ Interface: w29ee011 +// +// Description: Support for the Winbond W29EE011 +// Source: Datasheet +// +// +// Author: Markus Boas ryven@ryven.de, (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef _W29EE011_H_ +#define _W29EE011_H_
+extern int probe_w29ee011(struct flashchip *flash);
+#endif
Drop this file completely please, the function prototype is in flash.h already and this file is useless.
Also, please update the README file with the newly supported chip. Otherwise the patch looks good.
Thanks, Uwe.