LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v6 3/6] video, sm501: add edid and commandline support
From: Grant Likely @ 2011-05-02 22:27 UTC (permalink / raw)
  To: Heiko Schocher
  Cc: linux-fbdev, devicetree-discuss, Samuel Ortiz, Vincent Sanders,
	linux-kernel, Ben Dooks, Randy Dunlap, Paul Mundt, linuxppc-dev,
	Wolfgang Denk
In-Reply-To: <1300782452-528-4-git-send-email-hs@denx.de>

On Tue, Mar 22, 2011 at 09:27:29AM +0100, Heiko Schocher wrote:
> - add commandline options:
>   sm501fb.mode:
>     Specify resolution as "<xres>x<yres>[-<bpp>][@<refresh>]"
>   sm501fb.bpp:
>     Specify bit-per-pixel if not specified mode
> 
> - Add support for encoding display mode information
>   in the device tree using verbatim EDID block.
> 
>   If the "edid" entry in the "smi,sm501" node is present,
>   the driver will build mode database using EDID data
>   and allow setting the display modes from this database.
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>

Merged, thanks.

g.

> cc: Wolfram Sang <w.sang@pengutronix.de>
> cc: Grant Likely <grant.likely@secretlab.ca>
> cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> cc: linux-fbdev@vger.kernel.org
> cc: devicetree-discuss@ozlabs.org
> cc: Ben Dooks <ben@simtec.co.uk>
> cc: Vincent Sanders <vince@simtec.co.uk>
> cc: Samuel Ortiz <sameo@linux.intel.com>
> cc: linux-kernel@vger.kernel.org
> cc: Randy Dunlap <rdunlap@xenotime.net>
> cc: Wolfgang Denk <wd@denx.de>
> cc: Paul Mundt <lethal@linux-sh.org>
> ---
> - changes since v1:
>   add Ben Dooks, Vincent Sanders and Samuel Ortiz to cc, as suggested from
>   Paul Mundt.
> - changes since v2:
>   add comments from Randy Dunlap:
>   - move parameter documentation to Documentation/fb/sm501.txt
> - changes since v3:
>   - rebased against v2.6.38-rc2
>   - split in 3 patches
>     - of support patch
>     - i/o routine patch
>     - edid support patch
> - changes since v4:
>   - add "info->pdata = &sm501fb_def_pdata;" in sm501fb_probe()
>     as Paul Mundt suggested (and I wrongly deleted)
>   - move kfree(info->edid_data); to patch 3/4
>     as edid_data is only allocated in the CONFIG_OF case
> - changes for v6:
>   - repost complete patchserie
>   - rebased against current head
> 
>  Documentation/fb/sm501.txt |   10 +++++++
>  drivers/video/sm501fb.c    |   65 ++++++++++++++++++++++++++++++++++++++++---
>  2 files changed, 70 insertions(+), 5 deletions(-)
>  create mode 100644 Documentation/fb/sm501.txt
> 
> diff --git a/Documentation/fb/sm501.txt b/Documentation/fb/sm501.txt
> new file mode 100644
> index 0000000..8d17aeb
> --- /dev/null
> +++ b/Documentation/fb/sm501.txt
> @@ -0,0 +1,10 @@
> +Configuration:
> +
> +You can pass the following kernel command line options to sm501 videoframebuffer:
> +
> +	sm501fb.bpp=	SM501 Display driver:
> +			Specifiy bits-per-pixel if not specified by 'mode'
> +
> +	sm501fb.mode=	SM501 Display driver:
> +			Specify resolution as
> +			"<xres>x<yres>[-<bpp>][@<refresh>]"
> diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
> index 5df406c..f31252c 100644
> --- a/drivers/video/sm501fb.c
> +++ b/drivers/video/sm501fb.c
> @@ -41,6 +41,26 @@
>  #include <linux/sm501.h>
>  #include <linux/sm501-regs.h>
>  
> +#include "edid.h"
> +
> +static char *fb_mode = "640x480-16@60";
> +static unsigned long default_bpp = 16;
> +
> +static struct fb_videomode __devinitdata sm501_default_mode = {
> +	.refresh	= 60,
> +	.xres		= 640,
> +	.yres		= 480,
> +	.pixclock	= 20833,
> +	.left_margin	= 142,
> +	.right_margin	= 13,
> +	.upper_margin	= 21,
> +	.lower_margin	= 1,
> +	.hsync_len	= 69,
> +	.vsync_len	= 3,
> +	.sync		= FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> +	.vmode		= FB_VMODE_NONINTERLACED
> +};
> +
>  #define NR_PALETTE	256
>  
>  enum sm501_controller {
> @@ -77,6 +97,7 @@ struct sm501fb_info {
>  	void __iomem		*regs2d;	/* 2d remapped registers */
>  	void __iomem		*fbmem;		/* remapped framebuffer */
>  	size_t			 fbmem_len;	/* length of remapped region */
> +	u8 *edid_data;
>  };
>  
>  /* per-framebuffer private data */
> @@ -1725,9 +1746,16 @@ static int sm501fb_init_fb(struct fb_info *fb,
>  	fb->var.vmode		= FB_VMODE_NONINTERLACED;
>  	fb->var.bits_per_pixel  = 16;
>  
> +	if (info->edid_data) {
> +			/* Now build modedb from EDID */
> +			fb_edid_to_monspecs(info->edid_data, &fb->monspecs);
> +			fb_videomode_to_modelist(fb->monspecs.modedb,
> +						 fb->monspecs.modedb_len,
> +						 &fb->modelist);
> +	}
> +
>  	if (enable && (pd->flags & SM501FB_FLAG_USE_INIT_MODE) && 0) {
>  		/* TODO read the mode from the current display */
> -
>  	} else {
>  		if (pd->def_mode) {
>  			dev_info(info->dev, "using supplied mode\n");
> @@ -1737,12 +1765,34 @@ static int sm501fb_init_fb(struct fb_info *fb,
>  			fb->var.xres_virtual = fb->var.xres;
>  			fb->var.yres_virtual = fb->var.yres;
>  		} else {
> -			ret = fb_find_mode(&fb->var, fb,
> +			if (info->edid_data)
> +				ret = fb_find_mode(&fb->var, fb, fb_mode,
> +					fb->monspecs.modedb,
> +					fb->monspecs.modedb_len,
> +					&sm501_default_mode, default_bpp);
> +			else
> +				ret = fb_find_mode(&fb->var, fb,
>  					   NULL, NULL, 0, NULL, 8);
>  
> -			if (ret == 0 || ret == 4) {
> -				dev_err(info->dev,
> -					"failed to get initial mode\n");
> +			switch (ret) {
> +			case 1:
> +				dev_info(info->dev, "using mode specified in "
> +						"@mode\n");
> +				break;
> +			case 2:
> +				dev_info(info->dev, "using mode specified in "
> +					"@mode with ignored refresh rate\n");
> +				break;
> +			case 3:
> +				dev_info(info->dev, "using mode default "
> +					"mode\n");
> +				break;
> +			case 4:
> +				dev_info(info->dev, "using mode from list\n");
> +				break;
> +			default:
> +				dev_info(info->dev, "ret = %d\n", ret);
> +				dev_info(info->dev, "failed to find mode\n");
>  				return -EINVAL;
>  			}
>  		}
> @@ -2157,6 +2207,11 @@ static void __exit sm501fb_cleanup(void)
>  module_init(sm501fb_init);
>  module_exit(sm501fb_cleanup);
>  
> +module_param_named(mode, fb_mode, charp, 0);
> +MODULE_PARM_DESC(mode,
> +	"Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" ");
> +module_param_named(bpp, default_bpp, ulong, 0);
> +MODULE_PARM_DESC(bpp, "Specify bit-per-pixel if not specified mode");
>  MODULE_AUTHOR("Ben Dooks, Vincent Sanders");
>  MODULE_DESCRIPTION("SM501 Framebuffer driver");
>  MODULE_LICENSE("GPL v2");
> -- 
> 1.7.4
> 

^ permalink raw reply

* Re: [PATCH v6 2/6] video, sm501: add I/O functions for use on powerpc
From: Grant Likely @ 2011-05-02 22:24 UTC (permalink / raw)
  To: Heiko Schocher
  Cc: linux-fbdev, devicetree-discuss, Samuel Ortiz, Vincent Sanders,
	linux-kernel, Ben Dooks, Randy Dunlap, Paul Mundt, linuxppc-dev,
	Wolfgang Denk
In-Reply-To: <1300782452-528-3-git-send-email-hs@denx.de>

On Tue, Mar 22, 2011 at 09:27:28AM +0100, Heiko Schocher wrote:
> - add read/write functions for using this driver
>   also on powerpc plattforms
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Acked-by: Samuel Ortiz <sameo@linux.intel.com>

Merged, thanks.

g.

> cc: Wolfram Sang <w.sang@pengutronix.de>
> cc: Grant Likely <grant.likely@secretlab.ca>
> cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> cc: linux-fbdev@vger.kernel.org
> cc: devicetree-discuss@ozlabs.org
> cc: Ben Dooks <ben@simtec.co.uk>
> cc: Vincent Sanders <vince@simtec.co.uk>
> cc: Samuel Ortiz <sameo@linux.intel.com>
> cc: linux-kernel@vger.kernel.org
> cc: Randy Dunlap <rdunlap@xenotime.net>
> cc: Wolfgang Denk <wd@denx.de>
> cc: Paul Mundt <lethal@linux-sh.org>
> ---
> - changes since v1:
>   add Ben Dooks, Vincent Sanders and Samuel Ortiz to cc, as suggested from
>   Paul Mundt.
> - changes since v2:
>   add comments from Randy Dunlap:
>   - move parameter documentation to Documentation/fb/sm501.txt
> - changes since v3:
>   - rebased against v2.6.38-rc2
>   - split in 3 patches
>     - of support patch
>     - i/o routine patch
>       - use ioread/write32{be} accessors instead of
>         __do_readl/__do_writel{_be}
>     - edid support patch
> - changes for v6:
>   - repost complete patchserie
>   - rebased against current head
> 
>  drivers/mfd/sm501.c     |  125 +++++++++++++++++-----------------
>  drivers/video/sm501fb.c |  172 ++++++++++++++++++++++++----------------------
>  include/linux/sm501.h   |    8 ++
>  3 files changed, 161 insertions(+), 144 deletions(-)
> 
> diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
> index 5de3a76..558d5f3 100644
> --- a/drivers/mfd/sm501.c
> +++ b/drivers/mfd/sm501.c
> @@ -133,10 +133,10 @@ static unsigned long decode_div(unsigned long pll2, unsigned long val,
>  
>  static void sm501_dump_clk(struct sm501_devdata *sm)
>  {
> -	unsigned long misct = readl(sm->regs + SM501_MISC_TIMING);
> -	unsigned long pm0 = readl(sm->regs + SM501_POWER_MODE_0_CLOCK);
> -	unsigned long pm1 = readl(sm->regs + SM501_POWER_MODE_1_CLOCK);
> -	unsigned long pmc = readl(sm->regs + SM501_POWER_MODE_CONTROL);
> +	unsigned long misct = smc501_readl(sm->regs + SM501_MISC_TIMING);
> +	unsigned long pm0 = smc501_readl(sm->regs + SM501_POWER_MODE_0_CLOCK);
> +	unsigned long pm1 = smc501_readl(sm->regs + SM501_POWER_MODE_1_CLOCK);
> +	unsigned long pmc = smc501_readl(sm->regs + SM501_POWER_MODE_CONTROL);
>  	unsigned long sdclk0, sdclk1;
>  	unsigned long pll2 = 0;
>  
> @@ -193,29 +193,29 @@ static void sm501_dump_regs(struct sm501_devdata *sm)
>  	void __iomem *regs = sm->regs;
>  
>  	dev_info(sm->dev, "System Control   %08x\n",
> -			readl(regs + SM501_SYSTEM_CONTROL));
> +			smc501_readl(regs + SM501_SYSTEM_CONTROL));
>  	dev_info(sm->dev, "Misc Control     %08x\n",
> -			readl(regs + SM501_MISC_CONTROL));
> +			smc501_readl(regs + SM501_MISC_CONTROL));
>  	dev_info(sm->dev, "GPIO Control Low %08x\n",
> -			readl(regs + SM501_GPIO31_0_CONTROL));
> +			smc501_readl(regs + SM501_GPIO31_0_CONTROL));
>  	dev_info(sm->dev, "GPIO Control Hi  %08x\n",
> -			readl(regs + SM501_GPIO63_32_CONTROL));
> +			smc501_readl(regs + SM501_GPIO63_32_CONTROL));
>  	dev_info(sm->dev, "DRAM Control     %08x\n",
> -			readl(regs + SM501_DRAM_CONTROL));
> +			smc501_readl(regs + SM501_DRAM_CONTROL));
>  	dev_info(sm->dev, "Arbitration Ctrl %08x\n",
> -			readl(regs + SM501_ARBTRTN_CONTROL));
> +			smc501_readl(regs + SM501_ARBTRTN_CONTROL));
>  	dev_info(sm->dev, "Misc Timing      %08x\n",
> -			readl(regs + SM501_MISC_TIMING));
> +			smc501_readl(regs + SM501_MISC_TIMING));
>  }
>  
>  static void sm501_dump_gate(struct sm501_devdata *sm)
>  {
>  	dev_info(sm->dev, "CurrentGate      %08x\n",
> -			readl(sm->regs + SM501_CURRENT_GATE));
> +			smc501_readl(sm->regs + SM501_CURRENT_GATE));
>  	dev_info(sm->dev, "CurrentClock     %08x\n",
> -			readl(sm->regs + SM501_CURRENT_CLOCK));
> +			smc501_readl(sm->regs + SM501_CURRENT_CLOCK));
>  	dev_info(sm->dev, "PowerModeControl %08x\n",
> -			readl(sm->regs + SM501_POWER_MODE_CONTROL));
> +			smc501_readl(sm->regs + SM501_POWER_MODE_CONTROL));
>  }
>  
>  #else
> @@ -231,7 +231,7 @@ static inline void sm501_dump_clk(struct sm501_devdata *sm) { }
>  
>  static void sm501_sync_regs(struct sm501_devdata *sm)
>  {
> -	readl(sm->regs);
> +	smc501_readl(sm->regs);
>  }
>  
>  static inline void sm501_mdelay(struct sm501_devdata *sm, unsigned int delay)
> @@ -261,11 +261,11 @@ int sm501_misc_control(struct device *dev,
>  
>  	spin_lock_irqsave(&sm->reg_lock, save);
>  
> -	misc = readl(sm->regs + SM501_MISC_CONTROL);
> +	misc = smc501_readl(sm->regs + SM501_MISC_CONTROL);
>  	to = (misc & ~clear) | set;
>  
>  	if (to != misc) {
> -		writel(to, sm->regs + SM501_MISC_CONTROL);
> +		smc501_writel(to, sm->regs + SM501_MISC_CONTROL);
>  		sm501_sync_regs(sm);
>  
>  		dev_dbg(sm->dev, "MISC_CONTROL %08lx\n", misc);
> @@ -294,11 +294,11 @@ unsigned long sm501_modify_reg(struct device *dev,
>  
>  	spin_lock_irqsave(&sm->reg_lock, save);
>  
> -	data = readl(sm->regs + reg);
> +	data = smc501_readl(sm->regs + reg);
>  	data |= set;
>  	data &= ~clear;
>  
> -	writel(data, sm->regs + reg);
> +	smc501_writel(data, sm->regs + reg);
>  	sm501_sync_regs(sm);
>  
>  	spin_unlock_irqrestore(&sm->reg_lock, save);
> @@ -322,9 +322,9 @@ int sm501_unit_power(struct device *dev, unsigned int unit, unsigned int to)
>  
>  	mutex_lock(&sm->clock_lock);
>  
> -	mode = readl(sm->regs + SM501_POWER_MODE_CONTROL);
> -	gate = readl(sm->regs + SM501_CURRENT_GATE);
> -	clock = readl(sm->regs + SM501_CURRENT_CLOCK);
> +	mode = smc501_readl(sm->regs + SM501_POWER_MODE_CONTROL);
> +	gate = smc501_readl(sm->regs + SM501_CURRENT_GATE);
> +	clock = smc501_readl(sm->regs + SM501_CURRENT_CLOCK);
>  
>  	mode &= 3;		/* get current power mode */
>  
> @@ -356,14 +356,14 @@ int sm501_unit_power(struct device *dev, unsigned int unit, unsigned int to)
>  
>  	switch (mode) {
>  	case 1:
> -		writel(gate, sm->regs + SM501_POWER_MODE_0_GATE);
> -		writel(clock, sm->regs + SM501_POWER_MODE_0_CLOCK);
> +		smc501_writel(gate, sm->regs + SM501_POWER_MODE_0_GATE);
> +		smc501_writel(clock, sm->regs + SM501_POWER_MODE_0_CLOCK);
>  		mode = 0;
>  		break;
>  	case 2:
>  	case 0:
> -		writel(gate, sm->regs + SM501_POWER_MODE_1_GATE);
> -		writel(clock, sm->regs + SM501_POWER_MODE_1_CLOCK);
> +		smc501_writel(gate, sm->regs + SM501_POWER_MODE_1_GATE);
> +		smc501_writel(clock, sm->regs + SM501_POWER_MODE_1_CLOCK);
>  		mode = 1;
>  		break;
>  
> @@ -372,7 +372,7 @@ int sm501_unit_power(struct device *dev, unsigned int unit, unsigned int to)
>  		goto already;
>  	}
>  
> -	writel(mode, sm->regs + SM501_POWER_MODE_CONTROL);
> +	smc501_writel(mode, sm->regs + SM501_POWER_MODE_CONTROL);
>  	sm501_sync_regs(sm);
>  
>  	dev_dbg(sm->dev, "gate %08lx, clock %08lx, mode %08lx\n",
> @@ -519,9 +519,9 @@ unsigned long sm501_set_clock(struct device *dev,
>  			      unsigned long req_freq)
>  {
>  	struct sm501_devdata *sm = dev_get_drvdata(dev);
> -	unsigned long mode = readl(sm->regs + SM501_POWER_MODE_CONTROL);
> -	unsigned long gate = readl(sm->regs + SM501_CURRENT_GATE);
> -	unsigned long clock = readl(sm->regs + SM501_CURRENT_CLOCK);
> +	unsigned long mode = smc501_readl(sm->regs + SM501_POWER_MODE_CONTROL);
> +	unsigned long gate = smc501_readl(sm->regs + SM501_CURRENT_GATE);
> +	unsigned long clock = smc501_readl(sm->regs + SM501_CURRENT_CLOCK);
>  	unsigned char reg;
>  	unsigned int pll_reg = 0;
>  	unsigned long sm501_freq; /* the actual frequency achieved */
> @@ -592,9 +592,9 @@ unsigned long sm501_set_clock(struct device *dev,
>  
>  	mutex_lock(&sm->clock_lock);
>  
> -	mode = readl(sm->regs + SM501_POWER_MODE_CONTROL);
> -	gate = readl(sm->regs + SM501_CURRENT_GATE);
> -	clock = readl(sm->regs + SM501_CURRENT_CLOCK);
> +	mode = smc501_readl(sm->regs + SM501_POWER_MODE_CONTROL);
> +	gate = smc501_readl(sm->regs + SM501_CURRENT_GATE);
> +	clock = smc501_readl(sm->regs + SM501_CURRENT_CLOCK);
>  
>  	clock = clock & ~(0xFF << clksrc);
>  	clock |= reg<<clksrc;
> @@ -603,14 +603,14 @@ unsigned long sm501_set_clock(struct device *dev,
>  
>  	switch (mode) {
>  	case 1:
> -		writel(gate, sm->regs + SM501_POWER_MODE_0_GATE);
> -		writel(clock, sm->regs + SM501_POWER_MODE_0_CLOCK);
> +		smc501_writel(gate, sm->regs + SM501_POWER_MODE_0_GATE);
> +		smc501_writel(clock, sm->regs + SM501_POWER_MODE_0_CLOCK);
>  		mode = 0;
>  		break;
>  	case 2:
>  	case 0:
> -		writel(gate, sm->regs + SM501_POWER_MODE_1_GATE);
> -		writel(clock, sm->regs + SM501_POWER_MODE_1_CLOCK);
> +		smc501_writel(gate, sm->regs + SM501_POWER_MODE_1_GATE);
> +		smc501_writel(clock, sm->regs + SM501_POWER_MODE_1_CLOCK);
>  		mode = 1;
>  		break;
>  
> @@ -619,10 +619,11 @@ unsigned long sm501_set_clock(struct device *dev,
>  		return -1;
>  	}
>  
> -	writel(mode, sm->regs + SM501_POWER_MODE_CONTROL);
> +	smc501_writel(mode, sm->regs + SM501_POWER_MODE_CONTROL);
>  
>  	if (pll_reg)
> -		writel(pll_reg, sm->regs + SM501_PROGRAMMABLE_PLL_CONTROL);
> +		smc501_writel(pll_reg,
> +				sm->regs + SM501_PROGRAMMABLE_PLL_CONTROL);
>  
>  	sm501_sync_regs(sm);
>  
> @@ -902,7 +903,7 @@ static int sm501_gpio_get(struct gpio_chip *chip, unsigned offset)
>  	struct sm501_gpio_chip *smgpio = to_sm501_gpio(chip);
>  	unsigned long result;
>  
> -	result = readl(smgpio->regbase + SM501_GPIO_DATA_LOW);
> +	result = smc501_readl(smgpio->regbase + SM501_GPIO_DATA_LOW);
>  	result >>= offset;
>  
>  	return result & 1UL;
> @@ -915,13 +916,13 @@ static void sm501_gpio_ensure_gpio(struct sm501_gpio_chip *smchip,
>  
>  	/* check and modify if this pin is not set as gpio. */
>  
> -	if (readl(smchip->control) & bit) {
> +	if (smc501_readl(smchip->control) & bit) {
>  		dev_info(sm501_gpio_to_dev(smchip->ourgpio)->dev,
>  			 "changing mode of gpio, bit %08lx\n", bit);
>  
> -		ctrl = readl(smchip->control);
> +		ctrl = smc501_readl(smchip->control);
>  		ctrl &= ~bit;
> -		writel(ctrl, smchip->control);
> +		smc501_writel(ctrl, smchip->control);
>  
>  		sm501_sync_regs(sm501_gpio_to_dev(smchip->ourgpio));
>  	}
> @@ -942,10 +943,10 @@ static void sm501_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
>  
>  	spin_lock_irqsave(&smgpio->lock, save);
>  
> -	val = readl(regs + SM501_GPIO_DATA_LOW) & ~bit;
> +	val = smc501_readl(regs + SM501_GPIO_DATA_LOW) & ~bit;
>  	if (value)
>  		val |= bit;
> -	writel(val, regs);
> +	smc501_writel(val, regs);
>  
>  	sm501_sync_regs(sm501_gpio_to_dev(smgpio));
>  	sm501_gpio_ensure_gpio(smchip, bit);
> @@ -967,8 +968,8 @@ static int sm501_gpio_input(struct gpio_chip *chip, unsigned offset)
>  
>  	spin_lock_irqsave(&smgpio->lock, save);
>  
> -	ddr = readl(regs + SM501_GPIO_DDR_LOW);
> -	writel(ddr & ~bit, regs + SM501_GPIO_DDR_LOW);
> +	ddr = smc501_readl(regs + SM501_GPIO_DDR_LOW);
> +	smc501_writel(ddr & ~bit, regs + SM501_GPIO_DDR_LOW);
>  
>  	sm501_sync_regs(sm501_gpio_to_dev(smgpio));
>  	sm501_gpio_ensure_gpio(smchip, bit);
> @@ -994,18 +995,18 @@ static int sm501_gpio_output(struct gpio_chip *chip,
>  
>  	spin_lock_irqsave(&smgpio->lock, save);
>  
> -	val = readl(regs + SM501_GPIO_DATA_LOW);
> +	val = smc501_readl(regs + SM501_GPIO_DATA_LOW);
>  	if (value)
>  		val |= bit;
>  	else
>  		val &= ~bit;
> -	writel(val, regs);
> +	smc501_writel(val, regs);
>  
> -	ddr = readl(regs + SM501_GPIO_DDR_LOW);
> -	writel(ddr | bit, regs + SM501_GPIO_DDR_LOW);
> +	ddr = smc501_readl(regs + SM501_GPIO_DDR_LOW);
> +	smc501_writel(ddr | bit, regs + SM501_GPIO_DDR_LOW);
>  
>  	sm501_sync_regs(sm501_gpio_to_dev(smgpio));
> -	writel(val, regs + SM501_GPIO_DATA_LOW);
> +	smc501_writel(val, regs + SM501_GPIO_DATA_LOW);
>  
>  	sm501_sync_regs(sm501_gpio_to_dev(smgpio));
>  	spin_unlock_irqrestore(&smgpio->lock, save);
> @@ -1231,7 +1232,7 @@ static ssize_t sm501_dbg_regs(struct device *dev,
>  
>  	for (reg = 0x00; reg < 0x70; reg += 4) {
>  		ret = sprintf(ptr, "%08x = %08x\n",
> -			      reg, readl(sm->regs + reg));
> +			      reg, smc501_readl(sm->regs + reg));
>  		ptr += ret;
>  	}
>  
> @@ -1255,10 +1256,10 @@ static inline void sm501_init_reg(struct sm501_devdata *sm,
>  {
>  	unsigned long tmp;
>  
> -	tmp = readl(sm->regs + reg);
> +	tmp = smc501_readl(sm->regs + reg);
>  	tmp &= ~r->mask;
>  	tmp |= r->set;
> -	writel(tmp, sm->regs + reg);
> +	smc501_writel(tmp, sm->regs + reg);
>  }
>  
>  /* sm501_init_regs
> @@ -1299,7 +1300,7 @@ static void sm501_init_regs(struct sm501_devdata *sm,
>  
>  static int sm501_check_clocks(struct sm501_devdata *sm)
>  {
> -	unsigned long pwrmode = readl(sm->regs + SM501_CURRENT_CLOCK);
> +	unsigned long pwrmode = smc501_readl(sm->regs + SM501_CURRENT_CLOCK);
>  	unsigned long msrc = (pwrmode & SM501_POWERMODE_M_SRC);
>  	unsigned long m1src = (pwrmode & SM501_POWERMODE_M1_SRC);
>  
> @@ -1334,7 +1335,7 @@ static int __devinit sm501_init_dev(struct sm501_devdata *sm)
>  
>  	INIT_LIST_HEAD(&sm->devices);
>  
> -	devid = readl(sm->regs + SM501_DEVICEID);
> +	devid = smc501_readl(sm->regs + SM501_DEVICEID);
>  
>  	if ((devid & SM501_DEVICEID_IDMASK) != SM501_DEVICEID_SM501) {
>  		dev_err(sm->dev, "incorrect device id %08lx\n", devid);
> @@ -1342,9 +1343,9 @@ static int __devinit sm501_init_dev(struct sm501_devdata *sm)
>  	}
>  
>  	/* disable irqs */
> -	writel(0, sm->regs + SM501_IRQ_MASK);
> +	smc501_writel(0, sm->regs + SM501_IRQ_MASK);
>  
> -	dramctrl = readl(sm->regs + SM501_DRAM_CONTROL);
> +	dramctrl = smc501_readl(sm->regs + SM501_DRAM_CONTROL);
>  	mem_avail = sm501_mem_local[(dramctrl >> 13) & 0x7];
>  
>  	dev_info(sm->dev, "SM501 At %p: Version %08lx, %ld Mb, IRQ %d\n",
> @@ -1489,7 +1490,7 @@ static int sm501_plat_suspend(struct platform_device *pdev, pm_message_t state)
>  	struct sm501_devdata *sm = platform_get_drvdata(pdev);
>  
>  	sm->in_suspend = 1;
> -	sm->pm_misc = readl(sm->regs + SM501_MISC_CONTROL);
> +	sm->pm_misc = smc501_readl(sm->regs + SM501_MISC_CONTROL);
>  
>  	sm501_dump_regs(sm);
>  
> @@ -1513,9 +1514,9 @@ static int sm501_plat_resume(struct platform_device *pdev)
>  
>  	/* check to see if we are in the same state as when suspended */
>  
> -	if (readl(sm->regs + SM501_MISC_CONTROL) != sm->pm_misc) {
> +	if (smc501_readl(sm->regs + SM501_MISC_CONTROL) != sm->pm_misc) {
>  		dev_info(sm->dev, "SM501_MISC_CONTROL changed over sleep\n");
> -		writel(sm->pm_misc, sm->regs + SM501_MISC_CONTROL);
> +		smc501_writel(sm->pm_misc, sm->regs + SM501_MISC_CONTROL);
>  
>  		/* our suspend causes the controller state to change,
>  		 * either by something attempting setup, power loss,
> diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
> index bcb44a5..5df406c 100644
> --- a/drivers/video/sm501fb.c
> +++ b/drivers/video/sm501fb.c
> @@ -117,7 +117,7 @@ static inline int v_total(struct fb_var_screeninfo *var)
>  
>  static inline void sm501fb_sync_regs(struct sm501fb_info *info)
>  {
> -	readl(info->regs);
> +	smc501_readl(info->regs);
>  }
>  
>  /* sm501_alloc_mem
> @@ -262,7 +262,7 @@ static void sm501fb_setup_gamma(struct sm501fb_info *fbi,
>  
>  	/* set gamma values */
>  	for (offset = 0; offset < 256 * 4; offset += 4) {
> -		writel(value, fbi->regs + palette + offset);
> +		smc501_writel(value, fbi->regs + palette + offset);
>  		value += 0x010101; 	/* Advance RGB by 1,1,1.*/
>  	}
>  }
> @@ -476,7 +476,8 @@ static int sm501fb_set_par_common(struct fb_info *info,
>  
>  	/* set start of framebuffer to the screen */
>  
> -	writel(par->screen.sm_addr | SM501_ADDR_FLIP, fbi->regs + head_addr);
> +	smc501_writel(par->screen.sm_addr | SM501_ADDR_FLIP,
> +			fbi->regs + head_addr);
>  
>  	/* program CRT clock  */
>  
> @@ -519,7 +520,7 @@ static void sm501fb_set_par_geometry(struct fb_info *info,
>  	reg = info->fix.line_length;
>  	reg |= ((var->xres * var->bits_per_pixel)/8) << 16;
>  
> -	writel(reg, fbi->regs + (par->head == HEAD_CRT ?
> +	smc501_writel(reg, fbi->regs + (par->head == HEAD_CRT ?
>  		    SM501_DC_CRT_FB_OFFSET :  SM501_DC_PANEL_FB_OFFSET));
>  
>  	/* program horizontal total */
> @@ -527,27 +528,27 @@ static void sm501fb_set_par_geometry(struct fb_info *info,
>  	reg  = (h_total(var) - 1) << 16;
>  	reg |= (var->xres - 1);
>  
> -	writel(reg, base + SM501_OFF_DC_H_TOT);
> +	smc501_writel(reg, base + SM501_OFF_DC_H_TOT);
>  
>  	/* program horizontal sync */
>  
>  	reg  = var->hsync_len << 16;
>  	reg |= var->xres + var->right_margin - 1;
>  
> -	writel(reg, base + SM501_OFF_DC_H_SYNC);
> +	smc501_writel(reg, base + SM501_OFF_DC_H_SYNC);
>  
>  	/* program vertical total */
>  
>  	reg  = (v_total(var) - 1) << 16;
>  	reg |= (var->yres - 1);
>  
> -	writel(reg, base + SM501_OFF_DC_V_TOT);
> +	smc501_writel(reg, base + SM501_OFF_DC_V_TOT);
>  
>  	/* program vertical sync */
>  	reg  = var->vsync_len << 16;
>  	reg |= var->yres + var->lower_margin - 1;
>  
> -	writel(reg, base + SM501_OFF_DC_V_SYNC);
> +	smc501_writel(reg, base + SM501_OFF_DC_V_SYNC);
>  }
>  
>  /* sm501fb_pan_crt
> @@ -566,15 +567,15 @@ static int sm501fb_pan_crt(struct fb_var_screeninfo *var,
>  
>  	xoffs = var->xoffset * bytes_pixel;
>  
> -	reg = readl(fbi->regs + SM501_DC_CRT_CONTROL);
> +	reg = smc501_readl(fbi->regs + SM501_DC_CRT_CONTROL);
>  
>  	reg &= ~SM501_DC_CRT_CONTROL_PIXEL_MASK;
>  	reg |= ((xoffs & 15) / bytes_pixel) << 4;
> -	writel(reg, fbi->regs + SM501_DC_CRT_CONTROL);
> +	smc501_writel(reg, fbi->regs + SM501_DC_CRT_CONTROL);
>  
>  	reg = (par->screen.sm_addr + xoffs +
>  	       var->yoffset * info->fix.line_length);
> -	writel(reg | SM501_ADDR_FLIP, fbi->regs + SM501_DC_CRT_FB_ADDR);
> +	smc501_writel(reg | SM501_ADDR_FLIP, fbi->regs + SM501_DC_CRT_FB_ADDR);
>  
>  	sm501fb_sync_regs(fbi);
>  	return 0;
> @@ -593,10 +594,10 @@ static int sm501fb_pan_pnl(struct fb_var_screeninfo *var,
>  	unsigned long reg;
>  
>  	reg = var->xoffset | (var->xres_virtual << 16);
> -	writel(reg, fbi->regs + SM501_DC_PANEL_FB_WIDTH);
> +	smc501_writel(reg, fbi->regs + SM501_DC_PANEL_FB_WIDTH);
>  
>  	reg = var->yoffset | (var->yres_virtual << 16);
> -	writel(reg, fbi->regs + SM501_DC_PANEL_FB_HEIGHT);
> +	smc501_writel(reg, fbi->regs + SM501_DC_PANEL_FB_HEIGHT);
>  
>  	sm501fb_sync_regs(fbi);
>  	return 0;
> @@ -622,7 +623,7 @@ static int sm501fb_set_par_crt(struct fb_info *info)
>  	/* enable CRT DAC - note 0 is on!*/
>  	sm501_misc_control(fbi->dev->parent, 0, SM501_MISC_DAC_POWER);
>  
> -	control = readl(fbi->regs + SM501_DC_CRT_CONTROL);
> +	control = smc501_readl(fbi->regs + SM501_DC_CRT_CONTROL);
>  
>  	control &= (SM501_DC_CRT_CONTROL_PIXEL_MASK |
>  		    SM501_DC_CRT_CONTROL_GAMMA |
> @@ -684,7 +685,7 @@ static int sm501fb_set_par_crt(struct fb_info *info)
>   out_update:
>  	dev_dbg(fbi->dev, "new control is %08lx\n", control);
>  
> -	writel(control, fbi->regs + SM501_DC_CRT_CONTROL);
> +	smc501_writel(control, fbi->regs + SM501_DC_CRT_CONTROL);
>  	sm501fb_sync_regs(fbi);
>  
>  	return 0;
> @@ -696,18 +697,18 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
>  	void __iomem *ctrl_reg = fbi->regs + SM501_DC_PANEL_CONTROL;
>  	struct sm501_platdata_fbsub *pd = fbi->pdata->fb_pnl;
>  
> -	control = readl(ctrl_reg);
> +	control = smc501_readl(ctrl_reg);
>  
>  	if (to && (control & SM501_DC_PANEL_CONTROL_VDD) == 0) {
>  		/* enable panel power */
>  
>  		control |= SM501_DC_PANEL_CONTROL_VDD;	/* FPVDDEN */
> -		writel(control, ctrl_reg);
> +		smc501_writel(control, ctrl_reg);
>  		sm501fb_sync_regs(fbi);
>  		mdelay(10);
>  
>  		control |= SM501_DC_PANEL_CONTROL_DATA;	/* DATA */
> -		writel(control, ctrl_reg);
> +		smc501_writel(control, ctrl_reg);
>  		sm501fb_sync_regs(fbi);
>  		mdelay(10);
>  
> @@ -719,7 +720,7 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
>  			else
>  				control |= SM501_DC_PANEL_CONTROL_BIAS;
>  
> -			writel(control, ctrl_reg);
> +			smc501_writel(control, ctrl_reg);
>  			sm501fb_sync_regs(fbi);
>  			mdelay(10);
>  		}
> @@ -730,7 +731,7 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
>  			else
>  				control |= SM501_DC_PANEL_CONTROL_FPEN;
>  
> -			writel(control, ctrl_reg);
> +			smc501_writel(control, ctrl_reg);
>  			sm501fb_sync_regs(fbi);
>  			mdelay(10);
>  		}
> @@ -742,7 +743,7 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
>  			else
>  				control &= ~SM501_DC_PANEL_CONTROL_FPEN;
>  
> -			writel(control, ctrl_reg);
> +			smc501_writel(control, ctrl_reg);
>  			sm501fb_sync_regs(fbi);
>  			mdelay(10);
>  		}
> @@ -753,18 +754,18 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
>  			else
>  				control &= ~SM501_DC_PANEL_CONTROL_BIAS;
>  
> -			writel(control, ctrl_reg);
> +			smc501_writel(control, ctrl_reg);
>  			sm501fb_sync_regs(fbi);
>  			mdelay(10);
>  		}
>  
>  		control &= ~SM501_DC_PANEL_CONTROL_DATA;
> -		writel(control, ctrl_reg);
> +		smc501_writel(control, ctrl_reg);
>  		sm501fb_sync_regs(fbi);
>  		mdelay(10);
>  
>  		control &= ~SM501_DC_PANEL_CONTROL_VDD;
> -		writel(control, ctrl_reg);
> +		smc501_writel(control, ctrl_reg);
>  		sm501fb_sync_regs(fbi);
>  		mdelay(10);
>  	}
> @@ -799,7 +800,7 @@ static int sm501fb_set_par_pnl(struct fb_info *info)
>  
>  	/* update control register */
>  
> -	control = readl(fbi->regs + SM501_DC_PANEL_CONTROL);
> +	control = smc501_readl(fbi->regs + SM501_DC_PANEL_CONTROL);
>  	control &= (SM501_DC_PANEL_CONTROL_GAMMA |
>  		    SM501_DC_PANEL_CONTROL_VDD  |
>  		    SM501_DC_PANEL_CONTROL_DATA |
> @@ -833,16 +834,16 @@ static int sm501fb_set_par_pnl(struct fb_info *info)
>  		BUG();
>  	}
>  
> -	writel(0x0, fbi->regs + SM501_DC_PANEL_PANNING_CONTROL);
> +	smc501_writel(0x0, fbi->regs + SM501_DC_PANEL_PANNING_CONTROL);
>  
>  	/* panel plane top left and bottom right location */
>  
> -	writel(0x00, fbi->regs + SM501_DC_PANEL_TL_LOC);
> +	smc501_writel(0x00, fbi->regs + SM501_DC_PANEL_TL_LOC);
>  
>  	reg  = var->xres - 1;
>  	reg |= (var->yres - 1) << 16;
>  
> -	writel(reg, fbi->regs + SM501_DC_PANEL_BR_LOC);
> +	smc501_writel(reg, fbi->regs + SM501_DC_PANEL_BR_LOC);
>  
>  	/* program panel control register */
>  
> @@ -855,7 +856,7 @@ static int sm501fb_set_par_pnl(struct fb_info *info)
>  	if ((var->sync & FB_SYNC_VERT_HIGH_ACT) == 0)
>  		control |= SM501_DC_PANEL_CONTROL_VSP;
>  
> -	writel(control, fbi->regs + SM501_DC_PANEL_CONTROL);
> +	smc501_writel(control, fbi->regs + SM501_DC_PANEL_CONTROL);
>  	sm501fb_sync_regs(fbi);
>  
>  	/* ensure the panel interface is not tristated at this point */
> @@ -924,7 +925,7 @@ static int sm501fb_setcolreg(unsigned regno,
>  			val |= (green >> 8) << 8;
>  			val |= blue >> 8;
>  
> -			writel(val, base + (regno * 4));
> +			smc501_writel(val, base + (regno * 4));
>  		}
>  
>  		break;
> @@ -980,7 +981,7 @@ static int sm501fb_blank_crt(int blank_mode, struct fb_info *info)
>  
>  	dev_dbg(fbi->dev, "%s(mode=%d, %p)\n", __func__, blank_mode, info);
>  
> -	ctrl = readl(fbi->regs + SM501_DC_CRT_CONTROL);
> +	ctrl = smc501_readl(fbi->regs + SM501_DC_CRT_CONTROL);
>  
>  	switch (blank_mode) {
>  	case FB_BLANK_POWERDOWN:
> @@ -1004,7 +1005,7 @@ static int sm501fb_blank_crt(int blank_mode, struct fb_info *info)
>  
>  	}
>  
> -	writel(ctrl, fbi->regs + SM501_DC_CRT_CONTROL);
> +	smc501_writel(ctrl, fbi->regs + SM501_DC_CRT_CONTROL);
>  	sm501fb_sync_regs(fbi);
>  
>  	return 0;
> @@ -1041,12 +1042,14 @@ static int sm501fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
>  	if (cursor->image.depth > 1)
>  		return -EINVAL;
>  
> -	hwc_addr = readl(base + SM501_OFF_HWC_ADDR);
> +	hwc_addr = smc501_readl(base + SM501_OFF_HWC_ADDR);
>  
>  	if (cursor->enable)
> -		writel(hwc_addr | SM501_HWC_EN, base + SM501_OFF_HWC_ADDR);
> +		smc501_writel(hwc_addr | SM501_HWC_EN,
> +				base + SM501_OFF_HWC_ADDR);
>  	else
> -		writel(hwc_addr & ~SM501_HWC_EN, base + SM501_OFF_HWC_ADDR);
> +		smc501_writel(hwc_addr & ~SM501_HWC_EN,
> +				base + SM501_OFF_HWC_ADDR);
>  
>  	/* set data */
>  	if (cursor->set & FB_CUR_SETPOS) {
> @@ -1060,7 +1063,7 @@ static int sm501fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
>  
>  		//y += cursor->image.height;
>  
> -		writel(x | (y << 16), base + SM501_OFF_HWC_LOC);
> +		smc501_writel(x | (y << 16), base + SM501_OFF_HWC_LOC);
>  	}
>  
>  	if (cursor->set & FB_CUR_SETCMAP) {
> @@ -1080,8 +1083,8 @@ static int sm501fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
>  
>  		dev_dbg(fbi->dev, "fgcol %08lx, bgcol %08lx\n", fg, bg);
>  
> -		writel(bg, base + SM501_OFF_HWC_COLOR_1_2);
> -		writel(fg, base + SM501_OFF_HWC_COLOR_3);
> +		smc501_writel(bg, base + SM501_OFF_HWC_COLOR_1_2);
> +		smc501_writel(fg, base + SM501_OFF_HWC_COLOR_3);
>  	}
>  
>  	if (cursor->set & FB_CUR_SETSIZE ||
> @@ -1102,7 +1105,7 @@ static int sm501fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
>  			__func__, cursor->image.width, cursor->image.height);
>  
>  		for (op = 0; op < (64*64*2)/8; op+=4)
> -			writel(0x0, dst + op);
> +			smc501_writel(0x0, dst + op);
>  
>  		for (y = 0; y < cursor->image.height; y++) {
>  			for (x = 0; x < cursor->image.width; x++) {
> @@ -1141,7 +1144,7 @@ static ssize_t sm501fb_crtsrc_show(struct device *dev,
>  	struct sm501fb_info *info = dev_get_drvdata(dev);
>  	unsigned long ctrl;
>  
> -	ctrl = readl(info->regs + SM501_DC_CRT_CONTROL);
> +	ctrl = smc501_readl(info->regs + SM501_DC_CRT_CONTROL);
>  	ctrl &= SM501_DC_CRT_CONTROL_SEL;
>  
>  	return snprintf(buf, PAGE_SIZE, "%s\n", ctrl ? "crt" : "panel");
> @@ -1172,7 +1175,7 @@ static ssize_t sm501fb_crtsrc_store(struct device *dev,
>  
>  	dev_info(dev, "setting crt source to head %d\n", head);
>  
> -	ctrl = readl(info->regs + SM501_DC_CRT_CONTROL);
> +	ctrl = smc501_readl(info->regs + SM501_DC_CRT_CONTROL);
>  
>  	if (head == HEAD_CRT) {
>  		ctrl |= SM501_DC_CRT_CONTROL_SEL;
> @@ -1184,7 +1187,7 @@ static ssize_t sm501fb_crtsrc_store(struct device *dev,
>  		ctrl &= ~SM501_DC_CRT_CONTROL_TE;
>  	}
>  
> -	writel(ctrl, info->regs + SM501_DC_CRT_CONTROL);
> +	smc501_writel(ctrl, info->regs + SM501_DC_CRT_CONTROL);
>  	sm501fb_sync_regs(info);
>  
>  	return len;
> @@ -1205,7 +1208,8 @@ static int sm501fb_show_regs(struct sm501fb_info *info, char *ptr,
>  	unsigned int reg;
>  
>  	for (reg = start; reg < (len + start); reg += 4)
> -		ptr += sprintf(ptr, "%08x = %08x\n", reg, readl(mem + reg));
> +		ptr += sprintf(ptr, "%08x = %08x\n", reg,
> +				smc501_readl(mem + reg));
>  
>  	return ptr - buf;
>  }
> @@ -1257,7 +1261,7 @@ static int sm501fb_sync(struct fb_info *info)
>  
>  	/* wait for the 2d engine to be ready */
>  	while ((count > 0) &&
> -	       (readl(fbi->regs + SM501_SYSTEM_CONTROL) &
> +	       (smc501_readl(fbi->regs + SM501_SYSTEM_CONTROL) &
>  		SM501_SYSCTRL_2D_ENGINE_STATUS) != 0)
>  		count--;
>  
> @@ -1312,45 +1316,46 @@ static void sm501fb_copyarea(struct fb_info *info, const struct fb_copyarea *are
>  		return;
>  
>  	/* set the base addresses */
> -	writel(par->screen.sm_addr, fbi->regs2d + SM501_2D_SOURCE_BASE);
> -	writel(par->screen.sm_addr, fbi->regs2d + SM501_2D_DESTINATION_BASE);
> +	smc501_writel(par->screen.sm_addr, fbi->regs2d + SM501_2D_SOURCE_BASE);
> +	smc501_writel(par->screen.sm_addr,
> +			fbi->regs2d + SM501_2D_DESTINATION_BASE);
>  
>  	/* set the window width */
> -	writel((info->var.xres << 16) | info->var.xres,
> +	smc501_writel((info->var.xres << 16) | info->var.xres,
>  	       fbi->regs2d + SM501_2D_WINDOW_WIDTH);
>  
>  	/* set window stride */
> -	writel((info->var.xres_virtual << 16) | info->var.xres_virtual,
> +	smc501_writel((info->var.xres_virtual << 16) | info->var.xres_virtual,
>  	       fbi->regs2d + SM501_2D_PITCH);
>  
>  	/* set data format */
>  	switch (info->var.bits_per_pixel) {
>  	case 8:
> -		writel(0, fbi->regs2d + SM501_2D_STRETCH);
> +		smc501_writel(0, fbi->regs2d + SM501_2D_STRETCH);
>  		break;
>  	case 16:
> -		writel(0x00100000, fbi->regs2d + SM501_2D_STRETCH);
> +		smc501_writel(0x00100000, fbi->regs2d + SM501_2D_STRETCH);
>  		break;
>  	case 32:
> -		writel(0x00200000, fbi->regs2d + SM501_2D_STRETCH);
> +		smc501_writel(0x00200000, fbi->regs2d + SM501_2D_STRETCH);
>  		break;
>  	}
>  
>  	/* 2d compare mask */
> -	writel(0xffffffff, fbi->regs2d + SM501_2D_COLOR_COMPARE_MASK);
> +	smc501_writel(0xffffffff, fbi->regs2d + SM501_2D_COLOR_COMPARE_MASK);
>  
>  	/* 2d mask */
> -	writel(0xffffffff, fbi->regs2d + SM501_2D_MASK);
> +	smc501_writel(0xffffffff, fbi->regs2d + SM501_2D_MASK);
>  
>  	/* source and destination x y */
> -	writel((sx << 16) | sy, fbi->regs2d + SM501_2D_SOURCE);
> -	writel((dx << 16) | dy, fbi->regs2d + SM501_2D_DESTINATION);
> +	smc501_writel((sx << 16) | sy, fbi->regs2d + SM501_2D_SOURCE);
> +	smc501_writel((dx << 16) | dy, fbi->regs2d + SM501_2D_DESTINATION);
>  
>  	/* w/h */
> -	writel((width << 16) | height, fbi->regs2d + SM501_2D_DIMENSION);
> +	smc501_writel((width << 16) | height, fbi->regs2d + SM501_2D_DIMENSION);
>  
>  	/* do area move */
> -	writel(0x800000cc | rtl, fbi->regs2d + SM501_2D_CONTROL);
> +	smc501_writel(0x800000cc | rtl, fbi->regs2d + SM501_2D_CONTROL);
>  }
>  
>  static void sm501fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
> @@ -1372,47 +1377,49 @@ static void sm501fb_fillrect(struct fb_info *info, const struct fb_fillrect *rec
>  		return;
>  
>  	/* set the base addresses */
> -	writel(par->screen.sm_addr, fbi->regs2d + SM501_2D_SOURCE_BASE);
> -	writel(par->screen.sm_addr, fbi->regs2d + SM501_2D_DESTINATION_BASE);
> +	smc501_writel(par->screen.sm_addr, fbi->regs2d + SM501_2D_SOURCE_BASE);
> +	smc501_writel(par->screen.sm_addr,
> +			fbi->regs2d + SM501_2D_DESTINATION_BASE);
>  
>  	/* set the window width */
> -	writel((info->var.xres << 16) | info->var.xres,
> +	smc501_writel((info->var.xres << 16) | info->var.xres,
>  	       fbi->regs2d + SM501_2D_WINDOW_WIDTH);
>  
>  	/* set window stride */
> -	writel((info->var.xres_virtual << 16) | info->var.xres_virtual,
> +	smc501_writel((info->var.xres_virtual << 16) | info->var.xres_virtual,
>  	       fbi->regs2d + SM501_2D_PITCH);
>  
>  	/* set data format */
>  	switch (info->var.bits_per_pixel) {
>  	case 8:
> -		writel(0, fbi->regs2d + SM501_2D_STRETCH);
> +		smc501_writel(0, fbi->regs2d + SM501_2D_STRETCH);
>  		break;
>  	case 16:
> -		writel(0x00100000, fbi->regs2d + SM501_2D_STRETCH);
> +		smc501_writel(0x00100000, fbi->regs2d + SM501_2D_STRETCH);
>  		break;
>  	case 32:
> -		writel(0x00200000, fbi->regs2d + SM501_2D_STRETCH);
> +		smc501_writel(0x00200000, fbi->regs2d + SM501_2D_STRETCH);
>  		break;
>  	}
>  
>  	/* 2d compare mask */
> -	writel(0xffffffff, fbi->regs2d + SM501_2D_COLOR_COMPARE_MASK);
> +	smc501_writel(0xffffffff, fbi->regs2d + SM501_2D_COLOR_COMPARE_MASK);
>  
>  	/* 2d mask */
> -	writel(0xffffffff, fbi->regs2d + SM501_2D_MASK);
> +	smc501_writel(0xffffffff, fbi->regs2d + SM501_2D_MASK);
>  
>  	/* colour */
> -	writel(rect->color, fbi->regs2d + SM501_2D_FOREGROUND);
> +	smc501_writel(rect->color, fbi->regs2d + SM501_2D_FOREGROUND);
>  
>  	/* x y */
> -	writel((rect->dx << 16) | rect->dy, fbi->regs2d + SM501_2D_DESTINATION);
> +	smc501_writel((rect->dx << 16) | rect->dy,
> +			fbi->regs2d + SM501_2D_DESTINATION);
>  
>  	/* w/h */
> -	writel((width << 16) | height, fbi->regs2d + SM501_2D_DIMENSION);
> +	smc501_writel((width << 16) | height, fbi->regs2d + SM501_2D_DIMENSION);
>  
>  	/* do rectangle fill */
> -	writel(0x800100cc, fbi->regs2d + SM501_2D_CONTROL);
> +	smc501_writel(0x800100cc, fbi->regs2d + SM501_2D_CONTROL);
>  }
>  
>  
> @@ -1470,11 +1477,12 @@ static int sm501_init_cursor(struct fb_info *fbi, unsigned int reg_base)
>  
>  	/* initialise the colour registers */
>  
> -	writel(par->cursor.sm_addr, par->cursor_regs + SM501_OFF_HWC_ADDR);
> +	smc501_writel(par->cursor.sm_addr,
> +			par->cursor_regs + SM501_OFF_HWC_ADDR);
>  
> -	writel(0x00, par->cursor_regs + SM501_OFF_HWC_LOC);
> -	writel(0x00, par->cursor_regs + SM501_OFF_HWC_COLOR_1_2);
> -	writel(0x00, par->cursor_regs + SM501_OFF_HWC_COLOR_3);
> +	smc501_writel(0x00, par->cursor_regs + SM501_OFF_HWC_LOC);
> +	smc501_writel(0x00, par->cursor_regs + SM501_OFF_HWC_COLOR_1_2);
> +	smc501_writel(0x00, par->cursor_regs + SM501_OFF_HWC_COLOR_3);
>  	sm501fb_sync_regs(info);
>  
>  	return 0;
> @@ -1581,7 +1589,7 @@ static int sm501fb_start(struct sm501fb_info *info,
>  
>  	/* clear palette ram - undefined at power on */
>  	for (k = 0; k < (256 * 3); k++)
> -		writel(0, info->regs + SM501_DC_PANEL_PALETTE + (k * 4));
> +		smc501_writel(0, info->regs + SM501_DC_PANEL_PALETTE + (k * 4));
>  
>  	/* enable display controller */
>  	sm501_unit_power(dev->parent, SM501_GATE_DISPLAY, 1);
> @@ -1649,20 +1657,20 @@ static int sm501fb_init_fb(struct fb_info *fb,
>  	switch (head) {
>  	case HEAD_CRT:
>  		pd = info->pdata->fb_crt;
> -		ctrl = readl(info->regs + SM501_DC_CRT_CONTROL);
> +		ctrl = smc501_readl(info->regs + SM501_DC_CRT_CONTROL);
>  		enable = (ctrl & SM501_DC_CRT_CONTROL_ENABLE) ? 1 : 0;
>  
>  		/* ensure we set the correct source register */
>  		if (info->pdata->fb_route != SM501_FB_CRT_PANEL) {
>  			ctrl |= SM501_DC_CRT_CONTROL_SEL;
> -			writel(ctrl, info->regs + SM501_DC_CRT_CONTROL);
> +			smc501_writel(ctrl, info->regs + SM501_DC_CRT_CONTROL);
>  		}
>  
>  		break;
>  
>  	case HEAD_PANEL:
>  		pd = info->pdata->fb_pnl;
> -		ctrl = readl(info->regs + SM501_DC_PANEL_CONTROL);
> +		ctrl = smc501_readl(info->regs + SM501_DC_PANEL_CONTROL);
>  		enable = (ctrl & SM501_DC_PANEL_CONTROL_EN) ? 1 : 0;
>  		break;
>  
> @@ -1680,7 +1688,7 @@ static int sm501fb_init_fb(struct fb_info *fb,
>  
>  	if (head == HEAD_CRT && info->pdata->fb_route == SM501_FB_CRT_PANEL) {
>  		ctrl &= ~SM501_DC_CRT_CONTROL_SEL;
> -		writel(ctrl, info->regs + SM501_DC_CRT_CONTROL);
> +		smc501_writel(ctrl, info->regs + SM501_DC_CRT_CONTROL);
>  		enable = 0;
>  	}
>  
> @@ -2085,7 +2093,7 @@ static int sm501fb_suspend(struct platform_device *pdev, pm_message_t state)
>  	struct sm501fb_info *info = platform_get_drvdata(pdev);
>  
>  	/* store crt control to resume with */
> -	info->pm_crt_ctrl = readl(info->regs + SM501_DC_CRT_CONTROL);
> +	info->pm_crt_ctrl = smc501_readl(info->regs + SM501_DC_CRT_CONTROL);
>  
>  	sm501fb_suspend_fb(info, HEAD_CRT);
>  	sm501fb_suspend_fb(info, HEAD_PANEL);
> @@ -2109,10 +2117,10 @@ static int sm501fb_resume(struct platform_device *pdev)
>  
>  	/* restore the items we want to be saved for crt control */
>  
> -	crt_ctrl = readl(info->regs + SM501_DC_CRT_CONTROL);
> +	crt_ctrl = smc501_readl(info->regs + SM501_DC_CRT_CONTROL);
>  	crt_ctrl &= ~SM501_CRT_CTRL_SAVE;
>  	crt_ctrl |= info->pm_crt_ctrl & SM501_CRT_CTRL_SAVE;
> -	writel(crt_ctrl, info->regs + SM501_DC_CRT_CONTROL);
> +	smc501_writel(crt_ctrl, info->regs + SM501_DC_CRT_CONTROL);
>  
>  	sm501fb_resume_fb(info, HEAD_CRT);
>  	sm501fb_resume_fb(info, HEAD_PANEL);
> diff --git a/include/linux/sm501.h b/include/linux/sm501.h
> index 214f932..02fde50 100644
> --- a/include/linux/sm501.h
> +++ b/include/linux/sm501.h
> @@ -172,3 +172,11 @@ struct sm501_platdata {
>  	struct sm501_platdata_gpio_i2c	*gpio_i2c;
>  	unsigned int			 gpio_i2c_nr;
>  };
> +
> +#if defined(CONFIG_PPC32)
> +#define smc501_readl(addr)		ioread32be((addr))
> +#define smc501_writel(val, addr)	iowrite32be((val), (addr))
> +#else
> +#define smc501_readl(addr)		readl(addr)
> +#define smc501_writel(val, addr)	writel(val, addr)
> +#endif
> -- 
> 1.7.4
> 

^ permalink raw reply

* Re: [PATCH v6 0/6] powerpc, 52xx: add charon board support
From: Grant Likely @ 2011-05-02 22:14 UTC (permalink / raw)
  To: Heiko Schocher
  Cc: linux-fbdev, devicetree-discuss, Samuel Ortiz, Vincent Sanders,
	linux-kernel, Ben Dooks, Randy Dunlap, Paul Mundt, linuxppc-dev,
	Wolfgang Denk
In-Reply-To: <1300782452-528-1-git-send-email-hs@denx.de>

On Tue, Mar 22, 2011 at 09:27:26AM +0100, Heiko Schocher wrote:
> cc: Wolfram Sang <w.sang@pengutronix.de>
> cc: Grant Likely <grant.likely@secretlab.ca>
> cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> cc: linux-fbdev@vger.kernel.org
> cc: devicetree-discuss@ozlabs.org
> cc: Ben Dooks <ben@simtec.co.uk>
> cc: Vincent Sanders <vince@simtec.co.uk>
> cc: Samuel Ortiz <sameo@linux.intel.com>
> cc: linux-kernel@vger.kernel.org
> cc: Randy Dunlap <rdunlap@xenotime.net>
> cc: Wolfgang Denk <wd@denx.de>
> cc: Paul Mundt <lethal@linux-sh.org>
> 
> changes since v5:
> - repost complete patchseries, as Paul Mundt suggested
> - rebased against current head
> - add Acked-by from Samuel Ortiz (MFD parts)
>   http://www.spinics.net/lists/linux-fbdev/msg02550.html
>   http://linux.derkeiler.com/Mailing-Lists/Kernel/2011-01/msg11798.html
> 
>   and Benjamin Herrenschmidt (DTS parts)
>   http://lists.ozlabs.org/pipermail/linuxppc-dev/2011-February/088279.html
> - removed patch 
>   "powerpc, mpc5200: update mpc5200_defconfig to fit for charon board."
>   therefore added
>   "powerpc, tqm5200: update tqm5200_defconfig to fit for charon board."

Refresh my memory, why was the mpc5200_defconfig updated dropped?

g.

^ permalink raw reply

* Re: Login prompt on a video console instead of serial port?
From: Grant Likely @ 2011-05-02 20:12 UTC (permalink / raw)
  To: Timur Tabi; +Cc: linux-fbdev, devicetree-discuss, linuxppc-dev
In-Reply-To: <4DBF065C.3030407@freescale.com>

On Mon, May 2, 2011 at 1:30 PM, Timur Tabi <timur@freescale.com> wrote:
> I'm using a Freescale P1022DS (PowerPC e500 core) system, which has a bui=
lt-in
> video controller. =A0I have a framebuffer driver that works fine, and if =
I add
> "video=3Dfslfb:1280x1024-32@60,monitor=3D0 console=3Dtty0" to the command=
-line, then
> *most* of the kernel boot log appears on the serial port and the video di=
splay.
>
> However, the login prompt is always on the serial port. =A0This happens e=
ven if I
> delete the "console=3DttyS0,115200" from the command-line. =A0I presume t=
his is
> because the "linux,stdout-path" property in the device tree always points=
 to a
> serial port node.
>
> So my question is: what do I need to do get the login prompt on the video
> console? =A0That is, stdout goes to /dev/fb0 but stdin is still from /dev=
/ttyS0.
> I presume I need to direct "linux,stdout-path" to the fslfb node in the d=
evice
> tree, but there doesn't appear to be support for "linux,stdin-path".

Look in /etc/inittab.  That's usually where the login gettys are specified.

g.

>
> --
> Timur Tabi
> Linux kernel developer at Freescale
>
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
>



--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: Login prompt on a video console instead of serial port?
From: Timur Tabi @ 2011-05-02 20:02 UTC (permalink / raw)
  To: McClintock Matthew-B29882
  Cc: devicetree-discuss, linuxppc-dev@lists.ozlabs.org,
	linux-fbdev@vger.kernel.org
In-Reply-To: <BANLkTikWMksVsvs8KzjdiZfRR-2WGD0Ftw@mail.gmail.com>

McClintock Matthew-B29882 wrote:
> Don't you have to spawn a terminal on the framebuffer for the login?

I suppose, but I don't know how to do that.  And although that would technically
answer the question in the subject of this thread, I still would have *some*
boot output on the serial port.  It would be nice if I could get all of stdout
on the video display, and all of stdin from the serial port.

> Right now getty spawns the login on the serial port via /etc/inittab.
> Something similiar is probably needed for the framebuffer.

getty appears to work only with serial devices, since it insists on a baud rate
as one of the parameters.

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply

* Re: Login prompt on a video console instead of serial port?
From: McClintock Matthew-B29882 @ 2011-05-02 19:55 UTC (permalink / raw)
  To: Tabi Timur-B04825
  Cc: linux-fbdev@vger.kernel.org, devicetree-discuss,
	linuxppc-dev@lists.ozlabs.org
In-Reply-To: <4DBF065C.3030407@freescale.com>

Don't you have to spawn a terminal on the framebuffer for the login?
Right now getty spawns the login on the serial port via /etc/inittab.
Something similiar is probably needed for the framebuffer.

-M



On Mon, May 2, 2011 at 2:30 PM, Timur Tabi <timur@freescale.com> wrote:
> I'm using a Freescale P1022DS (PowerPC e500 core) system, which has a bui=
lt-in
> video controller. =A0I have a framebuffer driver that works fine, and if =
I add
> "video=3Dfslfb:1280x1024-32@60,monitor=3D0 console=3Dtty0" to the command=
-line, then
> *most* of the kernel boot log appears on the serial port and the video di=
splay.
>
> However, the login prompt is always on the serial port. =A0This happens e=
ven if I
> delete the "console=3DttyS0,115200" from the command-line. =A0I presume t=
his is
> because the "linux,stdout-path" property in the device tree always points=
 to a
> serial port node.
>
> So my question is: what do I need to do get the login prompt on the video
> console? =A0That is, stdout goes to /dev/fb0 but stdin is still from /dev=
/ttyS0.
> I presume I need to direct "linux,stdout-path" to the fslfb node in the d=
evice
> tree, but there doesn't appear to be support for "linux,stdin-path".=

^ permalink raw reply

* Login prompt on a video console instead of serial port?
From: Timur Tabi @ 2011-05-02 19:30 UTC (permalink / raw)
  To: linuxppc-dev, devicetree-discuss, linux-fbdev

I'm using a Freescale P1022DS (PowerPC e500 core) system, which has a built-in
video controller.  I have a framebuffer driver that works fine, and if I add
"video=fslfb:1280x1024-32@60,monitor=0 console=tty0" to the command-line, then
*most* of the kernel boot log appears on the serial port and the video display.

However, the login prompt is always on the serial port.  This happens even if I
delete the "console=ttyS0,115200" from the command-line.  I presume this is
because the "linux,stdout-path" property in the device tree always points to a
serial port node.

So my question is: what do I need to do get the login prompt on the video
console?  That is, stdout goes to /dev/fb0 but stdin is still from /dev/ttyS0.
I presume I need to direct "linux,stdout-path" to the fslfb node in the device
tree, but there doesn't appear to be support for "linux,stdin-path".

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply

* [tip:irq/urgent] genirq: Fix typo CONFIG_GENIRC_IRQ_SHOW_LEVEL
From: tip-bot for Geert Uytterhoeven @ 2011-05-02 19:18 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linuxppc-dev, tglx, mingo, geert, hpa

Commit-ID:  94b2c363dcf732a4edab4ed66041cb36e7f28fbf
Gitweb:     http://git.kernel.org/tip/94b2c363dcf732a4edab4ed66041cb36e7f28fbf
Author:     Geert Uytterhoeven <geert@linux-m68k.org>
AuthorDate: Sat, 30 Apr 2011 22:56:20 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 2 May 2011 21:16:37 +0200

genirq: Fix typo CONFIG_GENIRC_IRQ_SHOW_LEVEL

commit ab7798ffcf98b11a9525cf65bacdae3fd58d357f ("genirq: Expand generic
show_interrupts()") added the Kconfig option GENERIC_IRQ_SHOW_LEVEL to
accomodate PowerPC, but this doesn't actually enable the functionality due
to a typo in the #ifdef check.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Linux/PPC Development <linuxppc-dev@lists.ozlabs.org>
Link: http://lkml.kernel.org/r/%3Calpine.DEB.2.00.1104302251370.19068%40ayla.of.borg%3E
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/proc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index dd201bd..834899f 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -419,7 +419,7 @@ int show_interrupts(struct seq_file *p, void *v)
 	} else {
 		seq_printf(p, " %8s", "None");
 	}
-#ifdef CONFIG_GENIRC_IRQ_SHOW_LEVEL
+#ifdef CONFIG_GENERIC_IRQ_SHOW_LEVEL
 	seq_printf(p, " %-8s", irqd_is_level_type(&desc->irq_data) ? "Level" : "Edge");
 #endif
 	if (desc->name)

^ permalink raw reply related

* Re: [PATCH 2/2] powerpc: add support for MPIC message register API
From: Hollis Blanchard @ 2011-05-02 16:03 UTC (permalink / raw)
  To: Kushwaha Prabhakar-B32579
  Cc: Meador Inge, Wood Scott-B07421,
	devicetree-discuss@lists.ozlabs.org,
	linuxppc-dev@lists.ozlabs.org, openmcapi-dev@googlegroups.com
In-Reply-To: <071A08F2C6A57E4E94D980ECA553F8741984EE@039-SN1MPN1-004.039d.mgd.msft.net>

On 05/01/2011 08:41 PM, Kushwaha Prabhakar-B32579 wrote:
>>>>> Hi,
>>>>>
>>>>> I have no comments about coding and architecture. It looks fine.
>>>>>
>>>>> Only have a query about its use case..
>>>>>     "Any application intended to use message interrupt requires to
>>>>> know
>>>> reg_num because of struct mpic_msgr* mpic_msgr_get(unsigned int
>>>> reg_num) API"
>>>>> It will be good to search available unit internally and provide
>>>>> its
>>>> pointer. It will make application more flexible.
>>>> The problem is that you fundamentally cannot implement an allocator
>>>> for MSG registers if you're going to communicate with another kernel
>>>> (how would both kernels' allocators be synchronized?). So the
>>>> message register allocation must be decided at design time, not run time.
>>> I agree with you..  It is true while communicating with another kernel.
>>> But message interrupts can be used by different independent drivers
>> within same kernel. For eg. PCIe and Ethernet driver.
>>> As per current design both drivers needs to be in sync before
>> requesting any message unit for avoiding any conflict. As these drivers
>> are completely independent. It is very difficult.
>>> Can it be possible to provide new API to take care it.
>> Do you have a real use case in mind where these message registers (not
>> MSIs) are used internally in this manner?
> Yes, we use for PCIe host/agent test case scenario.
> Host usage message register to interrupt Agent...
> Agent uses message register to generate irq_out (automatically generate MSI) to interrupt master. Please see RM for more details about irq_out
>
>
> Note: PCIe host/agent test scenario is used internally and we are working on pushing it out..

I believe this has been true for several years.

>> Perhaps an allocator could be added in the same patchset that adds such a
>> user.
> Yaa. It can be done. Otherwise module has to query each message unit for its availability.

No, instead the system designer should pick one. If it doesn't matter 
which one, then the designer is free to pick any.

An allocator can't work if you're going to mix drivers. For example, 
driver A needs MSRG0, and driver B doesn't care. Driver B loads first, 
the allocator selects MSGR0; driver A loads and fails. Having an 
allocator at all will create this conflict.

To prevent this scenario, either don't use a MSGR (can you configure 
anything else for irq_out?), or have the system designer choose all MSGRs.

Hollis Blanchard
Mentor Graphics, Embedded Systems Division

^ permalink raw reply

* Re: Read/write BCSR registers of PPC460EX
From: Stefan Roese @ 2011-05-02 13:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linuxppc-dev
In-Reply-To: <31523658.post@talk.nabble.com>

Hi Efti,

On Monday 02 May 2011 15:36:15 linuxppc-dev wrote:
> Dear Stefan,
> 
> I have changed CPLD/BCSR address with 0x4E1000000.
> 
> static unsigned long mem_addr =  0x4E1000000;

Thats a 64bit address, so you need this:

static unsigned long long mem_addr =  0x4E1000000ULL;

You should have seen a compilation warning about this too.
 
Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office@denx.de

^ permalink raw reply

* Re: Read/write BCSR registers of PPC460EX
From: linuxppc-dev @ 2011-05-02 13:36 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <201105021453.32775.sr@denx.de>


Dear Stefan,

I have changed CPLD/BCSR address with 0x4E1000000.

static unsigned long mem_addr =  0x4E1000000;

But still I get the Machine check error When I load my module. I have posted
the error Message below.




Error Message
-------------

<4>minimod: module license 'unspecified' taints kernel.
<4>Disabling lock debugging due to kernel taint
<4>ioremap: Virtual Address e8f20000
<4>Machine check in kernel mode.
<4>Data Read PLB Error
<4>Oops: Machine check, sig: 7 [#1]
<4>PowerPC 44x Platform
<4>Modules linked in: minimod(P+)
<4>NIP: e4ff60ec LR: e4ff60d8 CTR: c0167174
<4>REGS: dfff7f10 TRAP: 0214   Tainted: P            (2.6.30.3)
<4>MSR: 00029000 <EE,ME,CE>  CR: 24000028  XER: 20000007
<4>TASK = de518000[956] 'insmod' THREAD: da282000
<6>GPR00: e4ff60d8 da283e90 de518000 00000025 00000000 ffffffff c01646c8
0000321d 
<6>GPR08: 00000000 e8f20000 0000321d 00004000 44000022 101c0dac 100ab618
10095434 
<6>GPR16: 100f0000 100f0000 bfee5eec 00000002 bfee5ef0 00000000 101ebf80
bfd0c274 
<6>GPR24: 10130a48 00000000 c0350000 c0326008 c0326014 e4ff0000 da282000
e4ff6524 
<4>NIP [e4ff60ec] io_driver_init+0x9c/0x150 [minimod]
<4>LR [e4ff60d8] io_driver_init+0x88/0x150 [minimod]
<4>Call Trace:
<4>[da283e90] [e4ff60d8] io_driver_init+0x88/0x150 [minimod] (unreliable)
<4>[da283eb0] [c00013d8] do_one_initcall+0x34/0x1a0
<4>[da283f20] [c004dc14] sys_init_module+0xb0/0x1b8
<4>[da283f40] [c000de8c] ret_from_syscall+0x0/0x3c
<4>Instruction dump:
<4>7c601b78 3c60e4ff 3fa0e4ff 386361ec 7c040378 901d6658 4800007d 813d6658 
<4>2f890000 419e004c 7c0004ac 80890000 <0c040000> 4c00012c 3c60e4ff 3863621c 
<4>---[ end trace 0af1ade6d5d6a053 ]---

Thanks,
Efti



Stefan Roese wrote:
> 
> On Monday 02 May 2011 14:40:39 Josh Boyer wrote:
>> >static unsigned long mem_addr = 0xC0000000;// IP base address
>> 
>> Is this the correct address for the BCSR?  On the 460EX Canyonlands
>> board, the CPLD/BCSR is at 0xE1000000.
> 
> To be precise: It's 0x4.e100.0000 as 36bit physical address.
>  
> Cheers,
> Stefan
> 
> --
> DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office@denx.de
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
> 
> 

-- 
View this message in context: http://old.nabble.com/Read-write-BCSR-registers-of-PPC460EX-tp31522823p31523658.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.

^ permalink raw reply

* Re: Read/write BCSR registers of PPC460EX
From: Stefan Roese @ 2011-05-02 12:53 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linuxppc-dev, linuxppc-dev
In-Reply-To: <20110502124039.GB3269@zod.rchland.ibm.com>

On Monday 02 May 2011 14:40:39 Josh Boyer wrote:
> >static unsigned long mem_addr = 0xC0000000;// IP base address
> 
> Is this the correct address for the BCSR?  On the 460EX Canyonlands
> board, the CPLD/BCSR is at 0xE1000000.

To be precise: It's 0x4.e100.0000 as 36bit physical address.
 
Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office@denx.de

^ permalink raw reply

* Re: Read/write BCSR registers of PPC460EX
From: Josh Boyer @ 2011-05-02 12:40 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linuxppc-dev
In-Reply-To: <31522823.post@talk.nabble.com>

On Mon, May 02, 2011 at 04:50:30AM -0700, linuxppc-dev wrote:
>
>Hi,
>
>I am trying to read the BCSR register of my PPC460ex board.But when I load
>the module, then I get the "Machine Check Error".
>
>I am not sure if I missed out something.
>
>I would really appreciate it if somebody could help me on this.
>
>I have posted the source code below, as well as the complete message.
>
>Thanks,
>efti
>
>Source code
>------------
>
>#include <linux/init.h> // to use module_init and module_exit
>#include <linux/module.h>// macros for modules
>#include <linux/kernel.h>
>#include <linux/ioport.h>
>#include <linux/errno.h>
>#include <asm/io.h>
>
>static unsigned int reg1 = 1; // test data
>static unsigned int reg2 = 2; // test data
>static unsigned int reg3 = 3; // test data
>static unsigned int *virtual_base = 0; // remapped address
>static unsigned long mem_addr = 0xC0000000;// IP base address

Is this the correct address for the BCSR?  On the 460EX Canyonlands
board, the CPLD/BCSR is at 0xE1000000.

>static unsigned long mem_size = 0x10000; // 64KB
>
>int io_driver_init(void)
>{
>	int i;
>	if(check_mem_region(mem_addr,mem_size))
>	{
>		printk("simp_mult: memory already in use\n");
>		return -EBUSY;
>	}
>	// request memory for the device
>	request_mem_region(mem_addr,mem_size,"simp_mult");
>	// remap
>	virtual_base = ioremap(mem_addr,mem_size);
>	printk("ioremap: Virtual Address %08x\n",(unsigned int)virtual_base);	
>	if( virtual_base==0 )
>	{
>		printk("ioremap failed\n");
>		return -EBUSY ;
>	}
>	else
>	{
>	
>	 unsigned int value;
>	 value = in_be32(virtual_base);
>	 printk("Data to Read : %08x\n",value);
>		
>		return 0; // indicate a success
>	}
>}

Aside from minor things like using unsigned int instead of unsigned
long, the code looks correct.  The thing to check is if you are
ioremapping the right physical address, and making sure you're reading a
proper location.

josh

^ permalink raw reply

* Read/write BCSR registers of PPC460EX
From: linuxppc-dev @ 2011-05-02 11:50 UTC (permalink / raw)
  To: linuxppc-dev


Hi,

I am trying to read the BCSR register of my PPC460ex board.But when I load
the module, then I get the "Machine Check Error".

I am not sure if I missed out something.

I would really appreciate it if somebody could help me on this.

I have posted the source code below, as well as the complete message.

Thanks,
efti

Source code
------------

#include <linux/init.h> // to use module_init and module_exit
#include <linux/module.h>// macros for modules
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/errno.h>
#include <asm/io.h>

static unsigned int reg1 = 1; // test data
static unsigned int reg2 = 2; // test data
static unsigned int reg3 = 3; // test data
static unsigned int *virtual_base = 0; // remapped address
static unsigned long mem_addr = 0xC0000000;// IP base address
static unsigned long mem_size = 0x10000; // 64KB

int io_driver_init(void)
{
	int i;
	if(check_mem_region(mem_addr,mem_size))
	{
		printk("simp_mult: memory already in use\n");
		return -EBUSY;
	}
	// request memory for the device
	request_mem_region(mem_addr,mem_size,"simp_mult");
	// remap
	virtual_base = ioremap(mem_addr,mem_size);
	printk("ioremap: Virtual Address %08x\n",(unsigned int)virtual_base);	
	if( virtual_base==0 )
	{
		printk("ioremap failed\n");
		return -EBUSY ;
	}
	else
	{
	
	 unsigned int value;
	 value = in_be32(virtual_base);
	 printk("Data to Read : %08x\n",value);
		
		return 0; // indicate a success
	}
}

void io_driver_exit(void)
{
	printk("Release Memory Region...\n") ;
	iounmap(virtual_base) ;
	release_mem_region(mem_addr,mem_size) ;
}

module_init(io_driver_init);
module_exit(io_driver_exit);



-- 
View this message in context: http://old.nabble.com/Read-write-BCSR-registers-of-PPC460EX-tp31522823p31522823.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.

^ permalink raw reply

* [PATCH 2/2] powerpc: Save Come-From Address Register (CFAR) in exception frame
From: Paul Mackerras @ 2011-05-02  5:48 UTC (permalink / raw)
  To: linuxppc-dev

Recent 64-bit server processors (POWER6 and POWER7) have a "Come-From
Address Register" (CFAR), that records the address of the most recent
branch or rfid (return from interrupt) instruction for debugging purposes.

This saves the value of the CFAR in the exception entry code and stores
it in the exception frame.  We also make xmon print the CFAR value in
its register dump code.

Rather than extend the pt_regs struct at this time, we steal the orig_gpr3
field, which is only used for system calls, and use it for the CFAR value
for all exceptions/interrupts other than system calls.  This means we
don't save the CFAR on system calls, which is not a great problem since
system calls tend not to happen unexpectedly, and also avoids adding the
overhead of reading the CFAR to the system call entry path.

Signed-off-by: Paul Mackerras <paulus@samba.org>
---
 arch/powerpc/include/asm/cputable.h      |    6 ++++--
 arch/powerpc/include/asm/exception-64s.h |    9 +++++++++
 arch/powerpc/include/asm/paca.h          |    6 +++---
 arch/powerpc/include/asm/reg.h           |    1 +
 arch/powerpc/kernel/exceptions-64s.S     |    4 ++++
 arch/powerpc/xmon/xmon.c                 |    4 ++++
 6 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index 3db2476..b0069ed 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -197,6 +197,7 @@ extern const char *powerpc_base_platform;
 #define CPU_FTR_STCX_CHECKS_ADDRESS	LONG_ASM_CONST(0x0200000000000000)
 #define CPU_FTR_POPCNTB			LONG_ASM_CONST(0x0400000000000000)
 #define CPU_FTR_POPCNTD			LONG_ASM_CONST(0x0800000000000000)
+#define CPU_FTR_CFAR			LONG_ASM_CONST(0x1000000000000000)
 
 #ifndef __ASSEMBLY__
 
@@ -411,14 +412,15 @@ extern const char *powerpc_base_platform;
 	    CPU_FTR_COHERENT_ICACHE | \
 	    CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
 	    CPU_FTR_DSCR | CPU_FTR_UNALIGNED_LD_STD | \
-	    CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB)
+	    CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_CFAR)
 #define CPU_FTRS_POWER7 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_HVMODE_206 |\
 	    CPU_FTR_MMCRA | CPU_FTR_SMT | \
 	    CPU_FTR_COHERENT_ICACHE | \
 	    CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
 	    CPU_FTR_DSCR | CPU_FTR_SAO  | CPU_FTR_ASYM_SMT | \
-	    CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD)
+	    CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD |\
+	    CPU_FTR_CFAR)
 #define CPU_FTRS_CELL	(CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
 	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
 	    CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 96ccef1..f5dfe34 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -46,6 +46,7 @@
 #define EX_CCR		60
 #define EX_R3		64
 #define EX_LR		72
+#define EX_CFAR		80
 
 /*
  * We're short on space and time in the exception prolog, so we can't
@@ -66,6 +67,10 @@
 	std	r10,area+EX_R10(r13);					\
 	std	r11,area+EX_R11(r13);					\
 	std	r12,area+EX_R12(r13);					\
+	BEGIN_FTR_SECTION_NESTED(66);					\
+	mfspr	r10,SPRN_CFAR;						\
+	std	r10,area+EX_CFAR(r13);					\
+	END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66);		\
 	GET_SCRATCH0(r9);						\
 	std	r9,area+EX_R13(r13);					\
 	mfcr	r9
@@ -130,6 +135,10 @@
 	std	r9,GPR11(r1);						   \
 	std	r10,GPR12(r1);						   \
 	std	r11,GPR13(r1);						   \
+	BEGIN_FTR_SECTION_NESTED(66);					   \
+	ld	r10,area+EX_CFAR(r13);					   \
+	std	r10,ORIG_GPR3(r1);					   \
+	END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66);		   \
 	ld	r2,PACATOC(r13);	/* get kernel TOC into r2	*/ \
 	mflr	r9;			/* save LR in stackframe	*/ \
 	std	r9,_LINK(r1);						   \
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index 65c13c4..7412676 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -92,9 +92,9 @@ struct paca_struct {
 	 * Now, starting in cacheline 2, the exception save areas
 	 */
 	/* used for most interrupts/exceptions */
-	u64 exgen[10] __attribute__((aligned(0x80)));
-	u64 exmc[10];		/* used for machine checks */
-	u64 exslb[10];		/* used for SLB/segment table misses
+	u64 exgen[11] __attribute__((aligned(0x80)));
+	u64 exmc[11];		/* used for machine checks */
+	u64 exslb[11];		/* used for SLB/segment table misses
  				 * on the linear mapping */
 	/* SLB related definitions */
 	u16 vmalloc_sllp;
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 1f9ac12..47e3416 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -188,6 +188,7 @@
 
 #define SPRN_CTR	0x009	/* Count Register */
 #define SPRN_DSCR	0x11
+#define SPRN_CFAR	0x1c	/* Come From Address Register */
 #define SPRN_CTRLF	0x088
 #define SPRN_CTRLT	0x098
 #define   CTRL_CT	0xc0000000	/* current thread */
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 27ca8b7..0ec3b42 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -474,6 +474,10 @@ bad_stack:
 	std	r9,GPR11(r1)
 	std	r10,GPR12(r1)
 	std	r11,GPR13(r1)
+BEGIN_FTR_SECTION
+	ld	r10,EX_CFAR(r3)
+	std	r10,ORIG_GPR3(r1)
+END_FTR_SECTION_IFSET(CPU_FTR_CFAR)
 	SAVE_8GPRS(14,r1)
 	SAVE_10GPRS(22,r1)
 	lhz	r12,PACA_TRAP_SAVE(r13)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 60593ad..909804a 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -1497,6 +1497,10 @@ static void prregs(struct pt_regs *fp)
 #endif
 	printf("pc  = ");
 	xmon_print_symbol(fp->nip, " ", "\n");
+	if (TRAP(fp) != 0xc00 && cpu_has_feature(CPU_FTR_CFAR)) {
+		printf("cfar= ");
+		xmon_print_symbol(fp->orig_gpr3, " ", "\n");
+	}
 	printf("lr  = ");
 	xmon_print_symbol(fp->link, " ", "\n");
 	printf("msr = "REG"   cr  = %.8lx\n", fp->msr, fp->ccr);
-- 
1.7.4.1

^ permalink raw reply related

* [PATCH 1/2] powerpc: Save register r9-r13 values accurately on interrupt with bad stack
From: Paul Mackerras @ 2011-05-02  5:46 UTC (permalink / raw)
  To: linuxppc-dev

When we take an interrupt or exception from kernel mode and the stack
pointer is obviously not a kernel address (i.e. the top bit is 0), we
switch to an emergency stack, save register values and panic.  However,
on 64-bit server machines, we don't actually save the values of r9 - r13
at the time of the interrupt, but rather values corrupted by the
exception entry code for r12-r13, and nothing at all for r9-r11.

This fixes it by passing a pointer to the register save area in the paca
through to the bad_stack code in r3.  The register values are saved in
one of the paca register save areas (depending on which exception this
is).  Using the pointer in r3, the bad_stack code now retrieves the
saved values of r9 - r13 and stores them in the exception frame on the
emergency stack.  This also stores the normal exception frame marker
("regshere") in the exception frame.

Signed-off-by: Paul Mackerras <paulus@samba.org>
---
 arch/powerpc/include/asm/exception-64s.h |    7 ++++---
 arch/powerpc/kernel/exceptions-64s.S     |   20 +++++++++++++++++---
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index d6b4849..96ccef1 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -104,10 +104,11 @@
 	beq-	1f;							   \
 	ld	r1,PACAKSAVE(r13);	/* kernel stack to use		*/ \
 1:	cmpdi	cr1,r1,0;		/* check if r1 is in userspace	*/ \
-	bge-	cr1,2f;			/* abort if it is		*/ \
-	b	3f;							   \
-2:	li	r1,(n);			/* will be reloaded later	*/ \
+	blt+	cr1,3f;			/* abort if it is		*/ \
+	li	r1,(n);			/* will be reloaded later	*/ \
 	sth	r1,PACA_TRAP_SAVE(r13);					   \
+	std	r3,area+EX_R3(r13);					   \
+	addi	r3,r13,area;		/* r3 -> where regs are saved*/	   \
 	b	bad_stack;						   \
 3:	std	r9,_CCR(r1);		/* save CR in stackframe	*/ \
 	std	r11,_NIP(r1);		/* save SRR0 in stackframe	*/ \
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 226cc8c..27ca8b7 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -461,9 +461,20 @@ bad_stack:
 	std	r12,_XER(r1)
 	SAVE_GPR(0,r1)
 	SAVE_GPR(2,r1)
-	SAVE_4GPRS(3,r1)
-	SAVE_2GPRS(7,r1)
-	SAVE_10GPRS(12,r1)
+	ld	r10,EX_R3(r3)
+	std	r10,GPR3(r1)
+	SAVE_GPR(4,r1)
+	SAVE_4GPRS(5,r1)
+	ld	r9,EX_R9(r3)
+	ld	r10,EX_R10(r3)
+	SAVE_2GPRS(9,r1)
+	ld	r9,EX_R11(r3)
+	ld	r10,EX_R12(r3)
+	ld	r11,EX_R13(r3)
+	std	r9,GPR11(r1)
+	std	r10,GPR12(r1)
+	std	r11,GPR13(r1)
+	SAVE_8GPRS(14,r1)
 	SAVE_10GPRS(22,r1)
 	lhz	r12,PACA_TRAP_SAVE(r13)
 	std	r12,_TRAP(r1)
@@ -472,6 +483,9 @@ bad_stack:
 	li	r12,0
 	std	r12,0(r11)
 	ld	r2,PACATOC(r13)
+	ld	r11,exception_marker@toc(r2)
+	std	r12,RESULT(r1)
+	std	r11,STACK_FRAME_OVERHEAD-16(r1)
 1:	addi	r3,r1,STACK_FRAME_OVERHEAD
 	bl	.kernel_bad_stack
 	b	1b
-- 
1.7.4.1

^ permalink raw reply related

* RE: [PATCH 2/2] powerpc: add support for MPIC message register API
From: Kushwaha Prabhakar-B32579 @ 2011-05-02  3:41 UTC (permalink / raw)
  To: Wood Scott-B07421
  Cc: Meador Inge, openmcapi-dev@googlegroups.com,
	devicetree-discuss@lists.ozlabs.org, Hollis Blanchard,
	linuxppc-dev@lists.ozlabs.org
In-Reply-To: <20110429123051.4ed1ca01@schlenkerla.am.freescale.net>



>=20
> >
> >
> > > > Hi,
> > > >
> > > > I have no comments about coding and architecture. It looks fine.
> > > >
> > > > Only have a query about its use case..
> > > >    "Any application intended to use message interrupt requires to
> > > > know
> > > reg_num because of struct mpic_msgr* mpic_msgr_get(unsigned int
> > > reg_num) API"
> > > >
> > > > It will be good to search available unit internally and provide
> > > > its
> > > pointer. It will make application more flexible.
> > > >
> > >
> > > The problem is that you fundamentally cannot implement an allocator
> > > for MSG registers if you're going to communicate with another kernel
> > > (how would both kernels' allocators be synchronized?). So the
> > > message register allocation must be decided at design time, not run
> time.
> > >
> >
> > I agree with you..  It is true while communicating with another kernel.
> > But message interrupts can be used by different independent drivers
> within same kernel. For eg. PCIe and Ethernet driver.
> > As per current design both drivers needs to be in sync before
> requesting any message unit for avoiding any conflict. As these drivers
> are completely independent. It is very difficult.
> >
> > Can it be possible to provide new API to take care it.
>=20
> Do you have a real use case in mind where these message registers (not
> MSIs) are used internally in this manner?

Yes, we use for PCIe host/agent test case scenario.
Host usage message register to interrupt Agent...
Agent uses message register to generate irq_out (automatically generate MSI=
) to interrupt master. Please see RM for more details about irq_out
=20

Note: PCIe host/agent test scenario is used internally and we are working o=
n pushing it out..
=20
> Perhaps an allocator could be added in the same patchset that adds such a
> user.
>=20

Yaa. It can be done. Otherwise module has to query each message unit for it=
s availability.=20

--Prabhakar

^ permalink raw reply

* linux module cannot read/write BSCR Register.
From: linuxppc-dev @ 2011-05-01 11:43 UTC (permalink / raw)
  To: linuxppc-dev


Dear,

I am trying to write embedded linux kernel module to get the value of BCSR
registers for ppc460ex .
I am a newbie. How I access the BCSR register.

Thanks,
Efti   
-- 
View this message in context: http://old.nabble.com/linux-module-cannot-read-write-BSCR-Register.-tp31516688p31516688.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.

^ permalink raw reply

* linux module cannot read/write BSCR Register
From: Eftakhar Chowdhury @ 2011-05-01 11:56 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 184 bytes --]

Dear,


I am trying to write embedded linux kernel module to get the value of BCSR registers for ppc460ex .

I am a newbie. How I access the BCSR register.


Thanks,

Efti   

[-- Attachment #2: Type: text/html, Size: 314 bytes --]

^ permalink raw reply

* RE: [PATCH 0/1] ppc4xx: Fix PCIe scanning for the 460SX
From: Tirumala Marri @ 2011-05-01  4:28 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Ayman El-Khashab; +Cc: Paul Mackerras, linuxppc-dev
In-Reply-To: <1304109476.2513.243.camel@pasglop>

I'm tempted to put it in if Tirumala doesn't get to review it asap.
[Marri] Sorry for the late response. I don't see any issue with changes,
please go ahead.

^ permalink raw reply

* [PATCH] genirq: Fix typo CONFIG_GENIRC_IRQ_SHOW_LEVEL
From: Geert Uytterhoeven @ 2011-04-30 20:56 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Linux/PPC Development, Linux Kernel Development

commit ab7798ffcf98b11a9525cf65bacdae3fd58d357f ("genirq: Expand generic
show_interrupts()") added the Kconfig option GENERIC_IRQ_SHOW_LEVEL to
accomodate PowerPC, but this doesn't actually enable the functionality due
to a typo in the #ifdef check.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 kernel/irq/proc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index dd201bd..834899f 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -419,7 +419,7 @@ int show_interrupts(struct seq_file *p, void *v)
 	} else {
 		seq_printf(p, " %8s", "None");
 	}
-#ifdef CONFIG_GENIRC_IRQ_SHOW_LEVEL
+#ifdef CONFIG_GENERIC_IRQ_SHOW_LEVEL
 	seq_printf(p, " %-8s", irqd_is_level_type(&desc->irq_data) ? "Level" : "Edge");
 #endif
 	if (desc->name)
-- 
1.7.0.4

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply related

* Re: [PATCH 0/1] ppc4xx: Fix PCIe scanning for the 460SX
From: Benjamin Herrenschmidt @ 2011-04-29 20:37 UTC (permalink / raw)
  To: Ayman El-Khashab; +Cc: Tirumala Marri, Paul Mackerras, linuxppc-dev
In-Reply-To: <20110429170240.GA21384@crust.elkhashab.com>

On Fri, 2011-04-29 at 12:02 -0500, Ayman El-Khashab wrote:
> On Tue, Apr 12, 2011 at 07:09:49PM -0700, Tirumala Marri wrote:
> > You originally submitted the support for 460ex. Can you chime in (and
> > review Ayman patch) please ?
> > 
> > [Marri] Ben sure I will review it and send you my feedback in couple of
> > days.
> 
> Is there any update on this patch?  Any comment?  Any reason it _cant_
> be included?  

I'm tempted to put it in if Tirumala doesn't get to review it asap.

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH 0/6] General device tree irq domain infrastructure
From: Grant Likely @ 2011-04-29 17:43 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: Michal Simek, devicetree-discuss, x86, linux-kernel, Ralf Baechle,
	hpa, Dirk Brandewie, Thomas Gleixner, linuxppc-dev
In-Reply-To: <4DBAE461.7000307@linutronix.de>

On Fri, Apr 29, 2011 at 06:16:33PM +0200, Sebastian Andrzej Siewior wrote:
> Grant Likely wrote:
> >I'd really like to get patches 1-4 merged into 2.6.40.  Please test.
> >I'm also running through build testing here, and when it's complete
> >I'll push it out to a 'devicetree/irq-domain' branch on
> >git://git.secretlab.ca/git/linux-2.6
> 
> I pulled this, built and booted my x86-dt box and nothing exploded so far.
> 
> If you merge Linus' tree then you will get a conflict (sooner or later) in
> ioapic_of_irq_map() in arch/x86/kernel/devicetree.c:
> 
> -       return io_apic_setup_irq_pin_once(*out_hwirq, cpu_to_node(0), &attr);
>  -      if (io_apic_setup_irq_pin(hwirq, cpu_to_node(0), &attr))
> ++      if (io_apic_setup_irq_pin_once(hwirq, cpu_to_node(0), &attr))
> 
> Sebastian

Thanks Sebastian.  Unless you say otherwise, I'll take that as an Acked-by.  :-)

g.

^ permalink raw reply

* Re: [PATCH 2/2] powerpc: add support for MPIC message register API
From: Scott Wood @ 2011-04-29 17:30 UTC (permalink / raw)
  To: Kushwaha Prabhakar-B32579
  Cc: Meador Inge, openmcapi-dev@googlegroups.com,
	devicetree-discuss@lists.ozlabs.org, Hollis Blanchard,
	linuxppc-dev@lists.ozlabs.org
In-Reply-To: <071A08F2C6A57E4E94D980ECA553F8741967EC@039-SN1MPN1-004.039d.mgd.msft.net>

On Fri, 29 Apr 2011 17:27:06 +0000
Kushwaha Prabhakar-B32579 <B32579@freescale.com> wrote:

> 
> 
> > > Hi,
> > >
> > > I have no comments about coding and architecture. It looks fine.
> > >
> > > Only have a query about its use case..
> > >    "Any application intended to use message interrupt requires to know
> > reg_num because of struct mpic_msgr* mpic_msgr_get(unsigned int reg_num)
> > API"
> > >
> > > It will be good to search available unit internally and provide its
> > pointer. It will make application more flexible.
> > >
> > 
> > The problem is that you fundamentally cannot implement an allocator for
> > MSG registers if you're going to communicate with another kernel (how
> > would both kernels' allocators be synchronized?). So the message register
> > allocation must be decided at design time, not run time.
> > 
> 
> I agree with you..  It is true while communicating with another kernel.
> But message interrupts can be used by different independent drivers within same kernel. For eg. PCIe and Ethernet driver. 
> As per current design both drivers needs to be in sync before requesting any message unit for avoiding any conflict. As these drivers are completely independent. It is very difficult. 
> 
> Can it be possible to provide new API to take care it.

Do you have a real use case in mind where these message registers (not
MSIs) are used internally in this manner?

Perhaps an allocator could be added in the same patchset that adds such a
user.

-Scott

^ permalink raw reply

* RE: [PATCH 2/2] powerpc: add support for MPIC message register API
From: Kushwaha Prabhakar-B32579 @ 2011-04-29 17:27 UTC (permalink / raw)
  To: Hollis Blanchard
  Cc: Meador Inge, openmcapi-dev@googlegroups.com,
	devicetree-discuss@lists.ozlabs.org,
	linuxppc-dev@lists.ozlabs.org
In-Reply-To: <4DBAED5D.4060906@mentor.com>



> > Hi,
> >
> > I have no comments about coding and architecture. It looks fine.
> >
> > Only have a query about its use case..
> >    "Any application intended to use message interrupt requires to know
> reg_num because of struct mpic_msgr* mpic_msgr_get(unsigned int reg_num)
> API"
> >
> > It will be good to search available unit internally and provide its
> pointer. It will make application more flexible.
> >
>=20
> The problem is that you fundamentally cannot implement an allocator for
> MSG registers if you're going to communicate with another kernel (how
> would both kernels' allocators be synchronized?). So the message register
> allocation must be decided at design time, not run time.
>=20

I agree with you..  It is true while communicating with another kernel.
But message interrupts can be used by different independent drivers within =
same kernel. For eg. PCIe and Ethernet driver.=20
As per current design both drivers needs to be in sync before requesting an=
y message unit for avoiding any conflict. As these drivers are completely i=
ndependent. It is very difficult.=20

Can it be possible to provide new API to take care it.

--Prabhakar

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox