Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad68bb9f authored by Marek Vasut's avatar Marek Vasut Committed by Eric Miao
Browse files

ARM: pxa: Access SMEMC via virtual addresses



This is important because on PXA3xx, the physical mapping of SMEMC registers
differs from the one on PXA2xx. In order to get PCMCIA working on both PXA2xx
and PXA320, the PCMCIA driver was adjusted accordingly as well.

Also, various places in the kernel had to be patched to use
__raw_read/__raw_write.

Signed-off-by: default avatarMarek Vasut <marek.vasut@gmail.com>
Acked-by: default avatarHaojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: default avatarEric Miao <eric.y.miao@gmail.com>
parent 851982c1
Loading
Loading
Loading
Loading
+7 −6
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@
#include <mach/pxa2xx-regs.h>
#include <mach/pxa2xx-regs.h>
#include <mach/audio.h>
#include <mach/audio.h>
#include <mach/pxafb.h>
#include <mach/pxafb.h>
#include <mach/smemc.h>


#include <asm/hardware/it8152.h>
#include <asm/hardware/it8152.h>


@@ -392,9 +393,9 @@ static int cmx2xx_suspend(struct sys_device *dev, pm_message_t state)
	cmx2xx_pci_suspend();
	cmx2xx_pci_suspend();


	/* save MSC registers */
	/* save MSC registers */
	sleep_save_msc[0] = MSC0;
	sleep_save_msc[0] = __raw_readl(MSC0);
	sleep_save_msc[1] = MSC1;
	sleep_save_msc[1] = __raw_readl(MSC1);
	sleep_save_msc[2] = MSC2;
	sleep_save_msc[2] = __raw_readl(MSC2);


	/* setup power saving mode registers */
	/* setup power saving mode registers */
	PCFR = 0x0;
	PCFR = 0x0;
@@ -416,9 +417,9 @@ static int cmx2xx_resume(struct sys_device *dev)
	cmx2xx_pci_resume();
	cmx2xx_pci_resume();


	/* restore MSC registers */
	/* restore MSC registers */
	MSC0 = sleep_save_msc[0];
	__raw_writel(sleep_save_msc[0], MSC0);
	MSC1 = sleep_save_msc[1];
	__raw_writel(sleep_save_msc[1], MSC1);
	MSC2 = sleep_save_msc[2];
	__raw_writel(sleep_save_msc[2], MSC2);


	return 0;
	return 0;
}
}
+6 −4
Original line number Original line Diff line number Diff line
@@ -38,8 +38,10 @@
#include <linux/cpufreq.h>
#include <linux/cpufreq.h>
#include <linux/err.h>
#include <linux/err.h>
#include <linux/regulator/consumer.h>
#include <linux/regulator/consumer.h>
#include <linux/io.h>


#include <mach/pxa2xx-regs.h>
#include <mach/pxa2xx-regs.h>
#include <mach/smemc.h>


#ifdef DEBUG
#ifdef DEBUG
static unsigned int freq_debug;
static unsigned int freq_debug;
@@ -242,7 +244,7 @@ static void pxa27x_guess_max_freq(void)


static void init_sdram_rows(void)
static void init_sdram_rows(void)
{
{
	uint32_t mdcnfg = MDCNFG;
	uint32_t mdcnfg = __raw_readl(MDCNFG);
	unsigned int drac2 = 0, drac0 = 0;
	unsigned int drac2 = 0, drac0 = 0;


	if (mdcnfg & (MDCNFG_DE2 | MDCNFG_DE3))
	if (mdcnfg & (MDCNFG_DE2 | MDCNFG_DE3))
@@ -331,8 +333,8 @@ static int pxa_set_target(struct cpufreq_policy *policy,
	 * we need to preset the smaller DRI before the change.	 If we're
	 * we need to preset the smaller DRI before the change.	 If we're
	 * speeding up we need to set the larger DRI value after the change.
	 * speeding up we need to set the larger DRI value after the change.
	 */
	 */
	preset_mdrefr = postset_mdrefr = MDREFR;
	preset_mdrefr = postset_mdrefr = __raw_readl(MDREFR);
	if ((MDREFR & MDREFR_DRI_MASK) > mdrefr_dri(new_freq_mem)) {
	if ((preset_mdrefr & MDREFR_DRI_MASK) > mdrefr_dri(new_freq_mem)) {
		preset_mdrefr = (preset_mdrefr & ~MDREFR_DRI_MASK);
		preset_mdrefr = (preset_mdrefr & ~MDREFR_DRI_MASK);
		preset_mdrefr |= mdrefr_dri(new_freq_mem);
		preset_mdrefr |= mdrefr_dri(new_freq_mem);
	}
	}
@@ -370,7 +372,7 @@ static int pxa_set_target(struct cpufreq_policy *policy,
3:		nop							\n\
3:		nop							\n\
	  "
	  "
		     : "=&r" (unused)
		     : "=&r" (unused)
		     : "r" (&MDREFR), "r" (cclkcfg),
		     : "r" (MDREFR), "r" (cclkcfg),
		       "r" (preset_mdrefr), "r" (postset_mdrefr)
		       "r" (preset_mdrefr), "r" (postset_mdrefr)
		     : "r4", "r5");
		     : "r4", "r5");
	local_irq_restore(flags);
	local_irq_restore(flags);
+4 −3
Original line number Original line Diff line number Diff line
@@ -27,6 +27,7 @@
#include <mach/ohci.h>
#include <mach/ohci.h>
#include <mach/pxa2xx-regs.h>
#include <mach/pxa2xx-regs.h>
#include <mach/audio.h>
#include <mach/audio.h>
#include <mach/smemc.h>


#include "generic.h"
#include "generic.h"
#include "devices.h"
#include "devices.h"
@@ -255,9 +256,9 @@ static struct platform_device *devices[] __initdata = {
static void __init csb726_init(void)
static void __init csb726_init(void)
{
{
	pxa2xx_mfp_config(ARRAY_AND_SIZE(csb726_pin_config));
	pxa2xx_mfp_config(ARRAY_AND_SIZE(csb726_pin_config));
/*	MSC1 = 0x7ffc3ffc; *//* LAN9215/EXP_CS */
/*	__raw_writel(0x7ffc3ffc, MSC1); *//* LAN9215/EXP_CS */
/*	MSC2 = 0x06697ff4; *//* none/SM501 */
/*	__raw_writel(0x06697ff4, MSC2); *//* none/SM501 */
	MSC2 = (MSC2 & ~0xffff) | 0x7ff4; /* SM501 */
	__raw_writel((__raw_readl(MSC2) & ~0xffff) | 0x7ff4, MSC2); /* SM501 */


	pxa_set_ffuart_info(NULL);
	pxa_set_ffuart_info(NULL);
	pxa_set_btuart_info(NULL);
	pxa_set_btuart_info(NULL);
+1 −0
Original line number Original line Diff line number Diff line
@@ -28,6 +28,7 @@


#include <mach/reset.h>
#include <mach/reset.h>
#include <mach/gpio.h>
#include <mach/gpio.h>
#include <mach/smemc.h>


#include "generic.h"
#include "generic.h"


+5 −4
Original line number Original line Diff line number Diff line
@@ -32,6 +32,7 @@
#include <mach/pxa25x.h>
#include <mach/pxa25x.h>
#include <mach/h5000.h>
#include <mach/h5000.h>
#include <mach/udc.h>
#include <mach/udc.h>
#include <mach/smemc.h>


#include "generic.h"
#include "generic.h"


@@ -172,11 +173,11 @@ static unsigned long h5000_pin_config[] __initdata = {


static void fix_msc(void)
static void fix_msc(void)
{
{
	MSC0 = 0x129c24f2;
	__raw_writel(0x129c24f2, MSC0);
	MSC1 = 0x7ff424fa;
	__raw_writel(0x7ff424fa, MSC1);
	MSC2 = 0x7ff47ff4;
	__raw_writel(0x7ff47ff4, MSC2);


	MDREFR |= 0x02080000;
	__raw_writel(__raw_readl(MDREFR) | 0x02080000, MDREFR);
}
}


/*
/*
Loading