From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10649 invoked by alias); 23 Jun 2004 15:38:47 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 10640 invoked from network); 23 Jun 2004 15:38:46 -0000 Received: from unknown (HELO mailrelay1.ornis.com) (81.93.0.19) by sourceware.org with SMTP; 23 Jun 2004 15:38:46 -0000 Received: from mailgate2.ornis.com (av3.ornis.com [81.93.0.122]) by mailrelay1.ornis.com (8.11.6/8.11.6) with ESMTP id i5NFi9i14973 for ; Wed, 23 Jun 2004 17:44:09 +0200 Received: from diplodocus ([10.151.21.1]) by mailgate2.ornis.com (8.11.6/8.11.6) with ESMTP id i5NFci215905 for ; Wed, 23 Jun 2004 17:38:44 +0200 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Wed, 23 Jun 2004 15:38:00 -0000 Message-ID: <21143CB20D234947A0A74B008261104A01276748@diplodocus.adetel.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "LAFON-PUYO Michel" To: Subject: [ECOS] Boot from 32bits Flash ROM on PowerPC MBX860 => Solved X-SW-Source: 2004-06/txt/msg00223.txt.bz2 Hi ! I made some changes on AMD29xxxxx driver and on MBX hal. Now, Redboot can boot from the 32bits Flash Rom available on the board. My board is 4Mbits (4xAM29F080 =3D 4x1Mbits), so my changes supports only this configuration but it's very easy to extend that. Here are the changes. Michel=20 ******** mbx.S ********* --- packages/hal/powerpc/mbx/current/src/mbx.S 23 May 2002 23:04:25 -0000 1.10 +++ packages/hal/powerpc/mbx/current/src/mbx.S 22 Jun 2004 09:20:05 -0000 @@ -267,7 +267,6 @@ * Base Register initialization. */ /* BOOT ROM */ - lwi r3,0xfe000401 # 8-bit, GPCM #ifdef __50MHZ lwi r5,0xff800960 /* for 120nS devices, else 0xff800940 */ #else @@ -275,9 +274,11 @@ #endif #ifdef CYGHWR_HAL_POWERPC_MBX_BOOT_32BIT_FLASH // Then the 32-bit FLASH device is on CS0, the "ROM" is on CS7 + lwi r3,0xfc000401 # 8-bit, GPCM, base adress 0xfc000000 stw r3,BR7(r4) stw r5,OR7(r4) #else // Boot from 8-bit ROM - the default, on CS0 + lwi r3,0xfe000401 # 8-bit, GPCM, base adress 0xfe000000 stw r3,BR0(r4) stw r5,OR0(r4) #endif @@ -322,7 +323,6 @@ stw r5,OR6(r4) =20 /* FLASH */ - lwi r3,0xfc000001 # 32-bit, GPCM #ifdef __50MHZ lwi r5,0xff800940 #else @@ -330,9 +330,11 @@ #endif #ifdef CYGHWR_HAL_POWERPC_MBX_BOOT_32BIT_FLASH // Then the 32-bit FLASH device is on CS0, the "ROM" is on CS7 + lwi r3,0xfe000001 # 32-bit, GPCM, base adress 0xfe000000 stw r3,BR0(r4) stw r5,OR0(r4) #else // Boot from 8-bit ROM - so the 32-bit FLASH is on CS7 + lwi r3,0xfc000001 # 32-bit, GPCM, base adress 0xfc000000 stw r3,BR7(r4) stw r5,OR7(r4) #endif ******** flash_amd_am29xxxxx.cdl ********* --- packages/devs/flash/amd/am29xxxxx/current/cdl/flash_amd_am29xxxxx.cdl 24 Nov 2003 14:28:14 -0000 1.17 +++ packages/devs/flash/amd/am29xxxxx/current/cdl/flash_amd_am29xxxxx.cdl 21 Jun 2004 10:06:03 -0000 @@ -86,6 +86,16 @@ able to recognize and handle the AMD29F040B part in the family." } +=20=20=20=20 + cdl_option CYGHWR_DEVS_FLASH_AMD_AM29F080 { + display "AMD AM29F080 flash memory support" + default_value 0 + implements CYGINT_DEVS_FLASH_AMD_VARIANTS + description " + When this option is enabled, the AMD flash driver will be + able to recognize and handle the AMD29F080 + part in the family." + } =20 cdl_option CYGHWR_DEVS_FLASH_AMD_AM29LV128 { display "AMD AM29LV128 flash memory support" ******** flash_am29xxxx_parts.inl ******** --- packages/devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx_parts. inl 11 Apr 2004 11:47:17 -0000 1.21 +++ packages/devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx_parts. inl 21 Jun 2004 10:06:29 -0000 @@ -103,6 +103,18 @@ bufsiz : 1 }, #endif +#ifdef CYGHWR_DEVS_FLASH_AMD_AM29F080=20=20=20=20 + { // AM29F080 + device_id : FLASHWORD(0xd5), + block_size : 0x10000 * CYGNUM_FLASH_INTERLEAVE, + block_count: 16, + device_size: 0x100000 * CYGNUM_FLASH_INTERLEAVE, + base_mask : ~(0x100000 * CYGNUM_FLASH_INTERLEAVE - 1), + bootblock : false, + banked : false, + bufsiz : 1 + }, +#endif #ifdef CYGHWR_DEVS_FLASH_AMD_AM29LV160 { // MBM29LV160-T | AM29LV160-T device_id : FLASHWORD(0xc4), @@ -407,7 +419,7 @@ 0 }, bufsiz : 1 - } + }, #endif #ifdef CYGHWR_DEVS_FLASH_AMD_AM29F800 { // AM29F800-T ******** flash_am29xxxx.inl ************** --- packages/devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx.inl 23 Apr 2004 20:50:32 -0000 1.22 +++ packages/devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx.inl 21 Jun 2004 10:08:33 -0000 @@ -98,8 +98,15 @@ #endif =20 #if (_16AS8 =3D=3D 0) + +#ifdef CYGHWR_DEVS_FLASH_AMD_AM29F080 +# define FLASH_Setup_Addr1 (0x5555) +# define FLASH_Setup_Addr2 (0x2AAA) +#else # define FLASH_Setup_Addr1 (0x555) # define FLASH_Setup_Addr2 (0x2AA) +#endif + # define FLASH_VendorID_Addr (0) # define FLASH_DeviceID_Addr (1) # define FLASH_DeviceID_Addr2 (0x0e) @@ -212,8 +219,9 @@ flash_data_t* id =3D (flash_data_t*) data; flash_data_t w; long timeout =3D CYGNUM_FLASH_TIMEOUT_QUERY; - +=20=20=20=20 ROM =3D (flash_data_t*) CYGNUM_FLASH_BASE; +=20=20=20=20 f_s1 =3D FLASH_P2V(ROM+FLASH_Setup_Addr1); f_s2 =3D FLASH_P2V(ROM+FLASH_Setup_Addr2); -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss