From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Sun, 13 Jan 2008 22:32:50 -0500 Subject: [U-Boot-Users] [PATCH 1/2] Add support for a Freescale non-CPM SPIcontroller In-Reply-To: <1200281058.3654.12.camel@localhost.localdomain> References: <47897C0E.3010705@gmail.com> <1200281058.3654.12.camel@localhost.localdomain> Message-ID: <478AD7E2.1000807@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dave Liu wrote: > On Sun, 2008-01-13 at 10:48 +0800, Ben Warren wrote: > >> This patch adds support for the SPI controller found on Freescale >> PowerPC >> processors such as the MCP834x family. Additionally, a new config >> option, >> CONFIG_HARD_SPI, is added for general purpose SPI controller use. >> > > Ben, Could you make the SPI drivers more generic/reuseable? > IIRC, the 85xx part has the same SPI controller. > > Sure. I don't have nearly the insight into the various Freescale products that you and your colleagues do. > [snip] > > >> +#include >> +#include >> +#include >> > > Could you use the fsl_spi.h head? not 83xx.. > If the memory map is reused identically, then yes. > [snip] > > >> diff --git a/include/asm-ppc/immap_83xx.h b/include/asm- >> ppc/immap_83xx.h >> index 34ea295..07ff400 100644 >> --- a/include/asm-ppc/immap_83xx.h >> +++ b/include/asm-ppc/immap_83xx.h >> @@ -397,6 +397,18 @@ typedef struct spi83xx { >> u8 res1[0xFD8]; >> } spi83xx_t; >> >> +typedef struct spi834x >> +{ >> + u8 res0[0x20]; /* 0x0-0x01f reserved */ >> + u32 mode; /* mode register */ >> + u32 event; /* event register */ >> + u32 mask; /* mask register */ >> + u32 com; /* command register */ >> + u32 tx; /* transmit register */ >> + u32 rx; /* receive register */ >> + u8 res1[0xC8]; /* fill up to 0x100 */ >> + } spi834x_t; >> > > please put this into fsl_spi.h to reuse for different 8xxx family. > Can you confirm that the registers in 85xx are the same? If so, I'll move this. > Thanks, > Dave > > >