Re: [linux-sunxi] [A10] Getting u-boot onto freshly partitioned Nand for booting Linux

2014-03-02 Thread hunter hu
Hi Timo,

I had the same issue I could not make the NAND boot work. With the 
u-boot.bin from lichee-dev branch, my tablet stuck at the logo screen:

1> which board did you build for your tablet?
2> what modifications have you made, you said with header modifications?
3> Anything regarding DRAM settings needed? we needed  a dram file in our 
sunxi branch.
4> where in the code does it indicate to configure where we put uImage and 
script.bin?

Great thanks in advance,
-Hunter

On Tuesday, September 24, 2013 4:34:55 PM UTC-5, timo.s...@gmail.com wrote:
>
> Finally made it!
>
> While looking at the modifications I made for u-boot, I realized that 
> script.bin and uImage belong to the same folder, i.e. the root folder of 
> the bootloader partition. Moving uImage, the system now boots perfectly 
> fine.
>
> Thanks for all your input!
>
> Timo
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[linux-sunxi] Re: [PATCH 6/7] regulator: AXP20x: Add support for regulators subsystem

2014-03-02 Thread Mark Brown
On Sat, Mar 01, 2014 at 05:45:51PM +0100, Carlo Caione wrote:

> index d59c826..0cef101 100644
> --- a/arch/arm/configs/sunxi_defconfig
> +++ b/arch/arm/configs/sunxi_defconfig
> @@ -69,3 +69,4 @@ CONFIG_NFS_FS=y
>  CONFIG_ROOT_NFS=y
>  CONFIG_NLS=y
>  CONFIG_PRINTK_TIME=y
> +CONFIG_REGULATOR_AXP20X=y

If you want to update the defconfig do it in a separate patch.

> +static int axp20x_set_suspend_voltage(struct regulator_dev *rdev, int uV)
> +{
> + return regulator_set_voltage_sel_regmap(rdev, 0);
> +}

I'm not entirely clear what this is supposed to do but it's broken - it
both ignores the voltage that is passed in and immediately writes to the
normal voltage select register which will presumably distrupt the system.

> +static int axp20x_io_enable_regmap(struct regulator_dev *rdev)
> +{
> + return regmap_update_bits(rdev->regmap, rdev->desc->enable_reg,
> +   rdev->desc->enable_mask, AXP20X_IO_ENABLED);
> +}

Please make some helpers for this (or extend the existing ones to cope
with more than a single bit control) - there's several other devices
which have similar multi-bit controls so we should factor this out
rather than open coding.

> + np = of_node_get(pdev->dev.parent->of_node);
> + if (!np)
> + return 0;
> +
> + regulators = of_find_node_by_name(np, "regulators");
> + if (!regulators) {
> + dev_err(&pdev->dev, "regulators node not found\n");
> + return -EINVAL;
> + }

The driver should be able to start up with no configuration provided at
all except for the device being registered - the user won't be able to
change anything but they will be able to read the current state of the
hardware which can be useful for diagnostics.

> +static int axp20x_set_dcdc_workmode(struct regulator_dev *rdev, int id, u32 
> workmode)
> +{
> + unsigned int mask = AXP20X_WORKMODE_DCDC2_MASK;
> +
> + if ((id != AXP20X_DCDC2) && (id != AXP20X_DCDC3))
> + return -EINVAL;
> +
> + if (id == AXP20X_DCDC3)
> + mask = AXP20X_WORKMODE_DCDC3_MASK;
> +
> + return regmap_update_bits(rdev->regmap, AXP20X_DCDC_MODE, mask, 
> workmode);
> +}

What is a workmode?

> + pmic->rdev[i] = regulator_register(&pmic->rdesc[i], &config);
> + if (IS_ERR(pmic->rdev[i])) {

Use devm_regulator_register() and then you don't need to clean up the
regulators either.

> +static int __init axp20x_regulator_init(void)
> +{
> + return platform_driver_register(&axp20x_regulator_driver);
> +}
> +
> +subsys_initcall(axp20x_regulator_init);

module_platform_driver().


signature.asc
Description: Digital signature


Re: [linux-sunxi] [PATCH] arch/arm/mach-sun7i/pm/standby/mem_printk.c used non-const char arrays. However gcc 4.6.3 likes to replace these by calls to memcpy. memcpy doesn't exist in the kernel. Havin

2014-03-02 Thread Alejandro Mery


On 01/03/14 20:56, Danny Milosavljevic wrote:

---
  arch/arm/mach-sun7i/pm/standby/mem_printk.c |6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-sun7i/pm/standby/mem_printk.c 
b/arch/arm/mach-sun7i/pm/standby/mem_printk.c
index 357d7d5..840e61a 100644
--- a/arch/arm/mach-sun7i/pm/standby/mem_printk.c
+++ b/arch/arm/mach-sun7i/pm/standby/mem_printk.c
@@ -165,7 +165,7 @@ char *itoa(int value, char *string, int radix)
int  negative = 0;  //defualt is positive value
int  i;
int  j;
-   char digit_string[] = "0123456789ABCDEF"; 
+   const char *digit_string = "0123456789ABCDEF";

if(value == 0)
{
@@ -211,7 +211,7 @@ char *utoa(unsigned int value, char *string, int radix)
char stack[16];
int  i;
int  j;
-   char digit_string[] = "0123456789ABCDEF"; 
+   const char *digit_string = "0123456789ABCDEF";

if(value == 0)
{
@@ -366,7 +366,7 @@ __s32 print_align(char *string, __s32 len, __s32 align)
  {
//fill with space ' ' when align request,
//the max align length is 16 byte.
-   char fill_ch[] = "";
+   const char *fill_ch = "";
if (len < align)
{
//fill at right


thank you, applied into stage/sunxi-3.4. but next time please don't put 
the whole description of the patch in the first line, only a short and 
contextualized subject goes there.


cheers,
Alejandro Mery

--
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [linux-sunxi] [PATCH 3.4] sun7i_deconfig enable option for usable kernel

2014-03-02 Thread Alejandro Mery


On 02/03/14 16:10, Gerardo Di Iorio wrote:


Enable in sun7i_deconfig option for an usable kernel
I add nand,emac,ir,gpio,mmc

Signed-off-by: Gerardo Di Iorio >

---
 arch/arm/configs/sun7i_defconfig | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/configs/sun7i_defconfig 
b/arch/arm/configs/sun7i_defconfig

index 44f9bf4..3de48e4 100644
--- a/arch/arm/configs/sun7i_defconfig
+++ b/arch/arm/configs/sun7i_defconfig
@@ -436,6 +436,7 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=2
 CONFIG_CDROM_PKTCDVD=m
 CONFIG_ATA_OVER_ETH=m
+CONFIG_SUNXI_NAND=m
 CONFIG_SUNXI_DBGREG=m
 CONFIG_TI_DAC7512=m
 CONFIG_EEPROM_AT24=m
@@ -458,6 +459,9 @@ CONFIG_ATA=y
 # CONFIG_SATA_PMP is not set
 CONFIG_SW_SATA_AHCI_PLATFORM=y
 # CONFIG_ATA_SFF is not set
+CONFIG_NETDEVICES=y
+CONFIG_SUNXI_EMAC=y
+CONFIG_PHYLIB=y
 CONFIG_MD=y
 CONFIG_BLK_DEV_DM=y
 CONFIG_DM_DEBUG=y
@@ -586,6 +590,7 @@ CONFIG_INPUT_KEYRESET=y
 CONFIG_KEYBOARD_SUN4IKEYPAD=m
 CONFIG_KEYBOARD_SUN4I_KEYBOARD=m
 CONFIG_KEYBOARD_HV2605_KEYBOARD=y
+CONFIG_IR_SUNXI=m
 # CONFIG_MOUSE_PS2 is not set
 CONFIG_MOUSE_SYNAPTICS_USB=m
 CONFIG_INPUT_JOYSTICK=y
@@ -691,7 +696,9 @@ CONFIG_PPS=m
 CONFIG_PTP_1588_CLOCK=m
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_SUNXI=m
 CONFIG_W1=m
+CONFIG_W1_SUNXI=m
 CONFIG_W1_MASTER_GPIO=m
 CONFIG_POWER_SUPPLY=y
 CONFIG_AW_AXP=y
@@ -1057,6 +1064,7 @@ CONFIG_MMC_PARANOID_SD_INIT=y
 CONFIG_SDIO_UART=m
 CONFIG_MMC_USHC=m
 CONFIG_MMC_SUNXI_POWER_CONTROL=y
+CONFIG_MMC_SUNXI=y
 CONFIG_LEDS_CLASS=y
 CONFIG_LEDS_TRIGGER_TIMER=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
--
1.8.4.2


--
You received this message because you are subscribed to the Google 
Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to linux-sunxi+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


thank you, applied on stage/sunxi-3.4

cheers,
Alejandro Mery

--
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [linux-sunxi] [PATCH] Unify sunxi SPI driver a little more

2014-03-02 Thread Alejandro Mery


On 02/03/14 13:57, oli...@schinagl.nl wrote:

From: Olliver Schinagl 

Currently the unification happened by merging spi_sun4i and spi_sun5i
but the KConfig's remained split. This merges the KConfig's to SPI_SUNXI
and adjusts the spi driver likewise. Integration with spi for sun7i
should be easier now.

Signed-off-by: Olliver Schinagl 
---
  drivers/spi/Kconfig | 27 +++
  drivers/spi/Makefile|  3 +--
  drivers/spi/spi_sunxi.c | 36 ++--
  3 files changed, 26 insertions(+), 40 deletions(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index c4fb46a..7503a6c 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -355,28 +355,15 @@ config SPI_STMP3XXX
help
  SPI driver for Freescale STMP37xx/378x SoC SSP interface
  
-config SPI_SUN4I

-   tristate "SUN4I SPI Controller"
-   depends on ARCH_SUN4I
+config SPI_SUNXI
+   tristate "SUNXI SPI Controller"
+   depends on ARCH_SUN4I || ARCH_SUN5I
help
-   Allwinner Soc SPI controller,present on SUN4I chips.
+   Allwinner Soc SPI controller,present on sun4i and sun5i chips.
  
-config SUN4I_SPI_NDMA

-bool "SUN4I SPI Normal DMA mode select"
-depends on SPI_SUN4I
-help
-  This selects SPI DMA mode with DMA transfer
-  Y select NDMA mode and N select DDMA mode
-
-config SPI_SUN5I
-   tristate "SUN5I SPI Controller"
-   depends on ARCH_SUN5I
-   help
-   Allwinner Soc SPI controller,present on SUN5I chips.
-
-config SUN5I_SPI_NDMA
-bool "SUN5I SPI Normal DMA mode select"
-depends on SPI_SUN5I
+config SPI_SUNXI_NDMA
+bool "SUNXI SPI Normal DMA mode select"
+depends on SPI_SUNXI
  help
This selects SPI DMA mode with DMA transfer
Y select NDMA mode and N select DDMA mode
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index a13913f..a0041af 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -62,6 +62,5 @@ obj-$(CONFIG_SPI_TLE62X0) += spi-tle62x0.o
  obj-$(CONFIG_SPI_TOPCLIFF_PCH)+= spi-topcliff-pch.o
  obj-$(CONFIG_SPI_TXX9)+= spi-txx9.o
  obj-$(CONFIG_SPI_XILINX)  += spi-xilinx.o
-obj-$(CONFIG_SPI_SUN4I)+= spi_sunxi.o
-obj-$(CONFIG_SPI_SUN5I)+= spi_sunxi.o
+obj-$(CONFIG_SPI_SUNXI)+= spi_sunxi.o
  
diff --git a/drivers/spi/spi_sunxi.c b/drivers/spi/spi_sunxi.c

index a3792fd..055e292 100644
--- a/drivers/spi/spi_sunxi.c
+++ b/drivers/spi/spi_sunxi.c
@@ -92,7 +92,7 @@ struct sunxi_spi {
struct clk *mclk;  /* ahb spi gating bit */
unsigned long gpio_hdle;
  
-	#if defined(CONFIG_SUN4I_SPI_NDMA) || defined(CONFIG_SUN5I_SPI_NDMA)

+   #ifdef CONFIG_SPI_SUNXI_NDMA
enum sw_dma_ch dma_id;
enum sw_dmadir dma_dir;
int dma_hdle;
@@ -550,7 +550,7 @@ static struct sw_dma_client spi_dma_client[] = {
  };
  #endif
  
-#if defined CONFIG_SUN4I_SPI_NDMA || defined CONFIG_SUN5I_SPI_NDMA

+#ifdef CONFIG_SPI_SUNXI_NDMA
  /*
   * rx dma callback, disable the 1/4 fifo rx drq.
   * tx dma callback, disable the tx empty drq.
@@ -659,7 +659,7 @@ static int spi_sunxi_config_dma(struct sunxi_spi *aw_spi, 
enum sw_dmadir dma_dir
  #endif
  struct dma_hw_conf spi_hw_conf = {0};
  
- #if defined CONFIG_SUN4I_SPI_NDMA || defined CONFIG_SUN5I_SPI_NDMA

+ #ifdef CONFIG_SPI_SUNXI_NDMA
  //write
  if (dma_dir == SW_DMA_WDEV) {
spi_hw_conf.drqsrc_type  = N_DRQSRC_SDRAM;   // must be 
sdram,or sdram
@@ -705,7 +705,7 @@ static int spi_sunxi_config_dma(struct sunxi_spi *aw_spi, 
enum sw_dmadir dma_dir
  spi_hw_conf.xfer_type   = DMAXFER_D_SWORD_S_SWORD;
  spi_hw_conf.hf_irq  = SW_DMA_IRQ_FULL;
  
- #if defined CONFIG_SUN4I_SPI_NDMA || defined CONFIG_SUN5I_SPI_NDMA

+ #ifdef CONFIG_SPI_SUNXI_NDMA
  /* set src,dst, drq type,configuration */
  ret = sw_dma_config(aw_spi->dma_id, &spi_hw_conf);
  /* flush the transfer queue */
@@ -719,7 +719,7 @@ static int spi_sunxi_config_dma(struct sunxi_spi *aw_spi, 
enum sw_dmadir dma_dir
  
  /* 1. flush d-cache */

  spi_sunxi_cleanflush_dcache_region((void *)buf, len);
- #if defined CONFIG_SUN4I_SPI_NDMA || defined CONFIG_SUN5I_SPI_NDMA
+ #ifdef CONFIG_SPI_SUNXI_NDMA
  /* 2. enqueue dma transfer, --FIXME--: buf: virtual address, not physical 
address. */
  ret += sw_dma_enqueue(aw_spi->dma_id, (void *)aw_spi, (dma_addr_t)buf, 
len);
#else
@@ -745,7 +745,7 @@ static int spi_sunxi_prepare_dma(struct sunxi_spi *aw_spi, 
enum sw_dmadir dma_di
  {
  int ret = 0;
  int bus_num   = aw_spi->master->bus_num;
-#if defined CONFIG_SUN4I_SPI_NDMA || defined CONFIG_SUN5I_SPI_NDMA
+#ifdef CONFIG_SPI_SUNXI_NDMA
  aw_spi->dma_hdle = sw_dma_request(aw_spi->dma_id, 
&spi_dma_client[bus_num], NULL);
 

[linux-sunxi] [PATCH 3.4] sun7i_deconfig enable option for usable kernel

2014-03-02 Thread Gerardo Di Iorio
Enable in sun7i_deconfig option for an usable kernel
I add nand,emac,ir,gpio,mmc

Signed-off-by: Gerardo Di Iorio 
---
 arch/arm/configs/sun7i_defconfig | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/configs/sun7i_defconfig b/arch/arm/configs/sun7i_
defconfig
index 44f9bf4..3de48e4 100644
--- a/arch/arm/configs/sun7i_defconfig
+++ b/arch/arm/configs/sun7i_defconfig
@@ -436,6 +436,7 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=2
 CONFIG_CDROM_PKTCDVD=m
 CONFIG_ATA_OVER_ETH=m
+CONFIG_SUNXI_NAND=m
 CONFIG_SUNXI_DBGREG=m
 CONFIG_TI_DAC7512=m
 CONFIG_EEPROM_AT24=m
@@ -458,6 +459,9 @@ CONFIG_ATA=y
 # CONFIG_SATA_PMP is not set
 CONFIG_SW_SATA_AHCI_PLATFORM=y
 # CONFIG_ATA_SFF is not set
+CONFIG_NETDEVICES=y
+CONFIG_SUNXI_EMAC=y
+CONFIG_PHYLIB=y
 CONFIG_MD=y
 CONFIG_BLK_DEV_DM=y
 CONFIG_DM_DEBUG=y
@@ -586,6 +590,7 @@ CONFIG_INPUT_KEYRESET=y
 CONFIG_KEYBOARD_SUN4IKEYPAD=m
 CONFIG_KEYBOARD_SUN4I_KEYBOARD=m
 CONFIG_KEYBOARD_HV2605_KEYBOARD=y
+CONFIG_IR_SUNXI=m
 # CONFIG_MOUSE_PS2 is not set
 CONFIG_MOUSE_SYNAPTICS_USB=m
 CONFIG_INPUT_JOYSTICK=y
@@ -691,7 +696,9 @@ CONFIG_PPS=m
 CONFIG_PTP_1588_CLOCK=m
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_SUNXI=m
 CONFIG_W1=m
+CONFIG_W1_SUNXI=m
 CONFIG_W1_MASTER_GPIO=m
 CONFIG_POWER_SUPPLY=y
 CONFIG_AW_AXP=y
@@ -1057,6 +1064,7 @@ CONFIG_MMC_PARANOID_SD_INIT=y
 CONFIG_SDIO_UART=m
 CONFIG_MMC_USHC=m
 CONFIG_MMC_SUNXI_POWER_CONTROL=y
+CONFIG_MMC_SUNXI=y
 CONFIG_LEDS_CLASS=y
 CONFIG_LEDS_TRIGGER_TIMER=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
-- 
1.8.4.2

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [linux-sunxi] [PATCH] Unify sunxi SPI driver a little more

2014-03-02 Thread Alejandro Mery


On 02/03/14 13:57, oli...@schinagl.nl wrote:

From: Olliver Schinagl 

Currently the unification happened by merging spi_sun4i and spi_sun5i
but the KConfig's remained split. This merges the KConfig's to SPI_SUNXI
and adjusts the spi driver likewise. Integration with spi for sun7i
should be easier now.

Signed-off-by: Olliver Schinagl 
---
  drivers/spi/Kconfig | 27 +++
  drivers/spi/Makefile|  3 +--
  drivers/spi/spi_sunxi.c | 36 ++--
  3 files changed, 26 insertions(+), 40 deletions(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index c4fb46a..7503a6c 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -355,28 +355,15 @@ config SPI_STMP3XXX
help
  SPI driver for Freescale STMP37xx/378x SoC SSP interface
  
-config SPI_SUN4I

-   tristate "SUN4I SPI Controller"
-   depends on ARCH_SUN4I
+config SPI_SUNXI
+   tristate "SUNXI SPI Controller"
+   depends on ARCH_SUN4I || ARCH_SUN5I
help
-   Allwinner Soc SPI controller,present on SUN4I chips.
+   Allwinner Soc SPI controller,present on sun4i and sun5i chips.


how about a second patch setting default m and removing them from defconfig?

--
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [linux-sunxi] Fedora porting in A20.

2014-03-02 Thread Olliver Schinagl

On 02/28/14 13:58, Puneet B wrote:


In Fedora,

Is it possible to port vlc and mplayer with cedarx by using fallowing link.

Should be


http://linux-sunxi.org/VLC

Haven't tried this one



http://linux-sunxi.org/Cedrus

I wrote the guide using Fedora

have you fixed your login issue? Inform the list on what you did :)


Regards
Punith

--
You received this message because you are subscribed to the Google
Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[linux-sunxi] [PATCH] Unify sunxi SPI driver a little more

2014-03-02 Thread oliver
From: Olliver Schinagl 

Currently the unification happened by merging spi_sun4i and spi_sun5i
but the KConfig's remained split. This merges the KConfig's to SPI_SUNXI
and adjusts the spi driver likewise. Integration with spi for sun7i
should be easier now.

Signed-off-by: Olliver Schinagl 
---
 drivers/spi/Kconfig | 27 +++
 drivers/spi/Makefile|  3 +--
 drivers/spi/spi_sunxi.c | 36 ++--
 3 files changed, 26 insertions(+), 40 deletions(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index c4fb46a..7503a6c 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -355,28 +355,15 @@ config SPI_STMP3XXX
help
  SPI driver for Freescale STMP37xx/378x SoC SSP interface
 
-config SPI_SUN4I
-   tristate "SUN4I SPI Controller"
-   depends on ARCH_SUN4I
+config SPI_SUNXI
+   tristate "SUNXI SPI Controller"
+   depends on ARCH_SUN4I || ARCH_SUN5I
help
-   Allwinner Soc SPI controller,present on SUN4I chips.
+   Allwinner Soc SPI controller,present on sun4i and sun5i chips.
 
-config SUN4I_SPI_NDMA
-bool "SUN4I SPI Normal DMA mode select"
-depends on SPI_SUN4I
-help
-  This selects SPI DMA mode with DMA transfer
-  Y select NDMA mode and N select DDMA mode
-
-config SPI_SUN5I
-   tristate "SUN5I SPI Controller"
-   depends on ARCH_SUN5I
-   help
-   Allwinner Soc SPI controller,present on SUN5I chips.
-
-config SUN5I_SPI_NDMA
-bool "SUN5I SPI Normal DMA mode select"
-depends on SPI_SUN5I
+config SPI_SUNXI_NDMA
+bool "SUNXI SPI Normal DMA mode select"
+depends on SPI_SUNXI
 help
   This selects SPI DMA mode with DMA transfer
   Y select NDMA mode and N select DDMA mode
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index a13913f..a0041af 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -62,6 +62,5 @@ obj-$(CONFIG_SPI_TLE62X0) += spi-tle62x0.o
 obj-$(CONFIG_SPI_TOPCLIFF_PCH) += spi-topcliff-pch.o
 obj-$(CONFIG_SPI_TXX9) += spi-txx9.o
 obj-$(CONFIG_SPI_XILINX)   += spi-xilinx.o
-obj-$(CONFIG_SPI_SUN4I)+= spi_sunxi.o
-obj-$(CONFIG_SPI_SUN5I)+= spi_sunxi.o
+obj-$(CONFIG_SPI_SUNXI)+= spi_sunxi.o
 
diff --git a/drivers/spi/spi_sunxi.c b/drivers/spi/spi_sunxi.c
index a3792fd..055e292 100644
--- a/drivers/spi/spi_sunxi.c
+++ b/drivers/spi/spi_sunxi.c
@@ -92,7 +92,7 @@ struct sunxi_spi {
struct clk *mclk;  /* ahb spi gating bit */
unsigned long gpio_hdle;
 
-   #if defined(CONFIG_SUN4I_SPI_NDMA) || defined(CONFIG_SUN5I_SPI_NDMA)
+   #ifdef CONFIG_SPI_SUNXI_NDMA
enum sw_dma_ch dma_id;
enum sw_dmadir dma_dir;
int dma_hdle;
@@ -550,7 +550,7 @@ static struct sw_dma_client spi_dma_client[] = {
 };
 #endif
 
-#if defined CONFIG_SUN4I_SPI_NDMA || defined CONFIG_SUN5I_SPI_NDMA
+#ifdef CONFIG_SPI_SUNXI_NDMA
 /*
  * rx dma callback, disable the 1/4 fifo rx drq.
  * tx dma callback, disable the tx empty drq.
@@ -659,7 +659,7 @@ static int spi_sunxi_config_dma(struct sunxi_spi *aw_spi, 
enum sw_dmadir dma_dir
 #endif
 struct dma_hw_conf spi_hw_conf = {0};
 
- #if defined CONFIG_SUN4I_SPI_NDMA || defined CONFIG_SUN5I_SPI_NDMA
+ #ifdef CONFIG_SPI_SUNXI_NDMA
 //write
 if (dma_dir == SW_DMA_WDEV) {
spi_hw_conf.drqsrc_type  = N_DRQSRC_SDRAM;   // must be 
sdram,or sdram
@@ -705,7 +705,7 @@ static int spi_sunxi_config_dma(struct sunxi_spi *aw_spi, 
enum sw_dmadir dma_dir
 spi_hw_conf.xfer_type   = DMAXFER_D_SWORD_S_SWORD;
 spi_hw_conf.hf_irq  = SW_DMA_IRQ_FULL;
 
- #if defined CONFIG_SUN4I_SPI_NDMA || defined CONFIG_SUN5I_SPI_NDMA
+ #ifdef CONFIG_SPI_SUNXI_NDMA
 /* set src,dst, drq type,configuration */
 ret = sw_dma_config(aw_spi->dma_id, &spi_hw_conf);
 /* flush the transfer queue */
@@ -719,7 +719,7 @@ static int spi_sunxi_config_dma(struct sunxi_spi *aw_spi, 
enum sw_dmadir dma_dir
 
 /* 1. flush d-cache */
 spi_sunxi_cleanflush_dcache_region((void *)buf, len);
- #if defined CONFIG_SUN4I_SPI_NDMA || defined CONFIG_SUN5I_SPI_NDMA
+ #ifdef CONFIG_SPI_SUNXI_NDMA
 /* 2. enqueue dma transfer, --FIXME--: buf: virtual address, not physical 
address. */
 ret += sw_dma_enqueue(aw_spi->dma_id, (void *)aw_spi, (dma_addr_t)buf, 
len);
#else
@@ -745,7 +745,7 @@ static int spi_sunxi_prepare_dma(struct sunxi_spi *aw_spi, 
enum sw_dmadir dma_di
 {
 int ret = 0;
 int bus_num   = aw_spi->master->bus_num;
-#if defined CONFIG_SUN4I_SPI_NDMA || defined CONFIG_SUN5I_SPI_NDMA
+#ifdef CONFIG_SPI_SUNXI_NDMA
 aw_spi->dma_hdle = sw_dma_request(aw_spi->dma_id, 
&spi_dma_client[bus_num], NULL);
 if(aw_spi->dma_hdle < 0) {
 spi_wrn("[spi-%d]: request dma failed!\n", bus_num);
@@ -788,7