All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 09/37] Blackfin: bf527-ezkit: video: convert from old style MMR macros
Date: Sat,  2 Oct 2010 16:05:35 -0400	[thread overview]
Message-ID: <1286049958-4125-8-git-send-email-vapier@gentoo.org> (raw)
In-Reply-To: <1286049958-4125-1-git-send-email-vapier@gentoo.org>

The old MMR defines are being scrubbed, so convert the driver to use the
new standard helper macros.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 board/bf527-ezkit/video.c |   76 +++++++++++++++++++++++---------------------
 1 files changed, 40 insertions(+), 36 deletions(-)

diff --git a/board/bf527-ezkit/video.c b/board/bf527-ezkit/video.c
index 51bdf02..87e7658 100644
--- a/board/bf527-ezkit/video.c
+++ b/board/bf527-ezkit/video.c
@@ -162,12 +162,12 @@ static int lq035q1_control(unsigned char reg, unsigned short value)
 /* enable and disable PPI functions */
 void EnablePPI(void)
 {
-	*pPPI_CONTROL |= PORT_EN;
+	bfin_write_PPI_CONTROL(bfin_read_PPI_CONTROL() | PORT_EN);
 }
 
 void DisablePPI(void)
 {
-	*pPPI_CONTROL &= ~PORT_EN;
+	bfin_write_PPI_CONTROL(bfin_read_PPI_CONTROL() & ~PORT_EN);
 }
 
 void Init_Ports(void)
@@ -182,119 +182,123 @@ void Init_Ports(void)
 void Init_PPI(void)
 {
 
-	*pPPI_DELAY = H_START;
-	*pPPI_COUNT = (H_ACTPIX-1);
-	*pPPI_FRAME = V_LINES;
+	bfin_write_PPI_DELAY(H_START);
+	bfin_write_PPI_COUNT(H_ACTPIX - 1);
+	bfin_write_PPI_FRAME(V_LINES);
 
 	/* PPI control, to be replaced with definitions */
-	*pPPI_CONTROL = PPI_TX_MODE		|	/* output mode , PORT_DIR */
+	bfin_write_PPI_CONTROL(
+			PPI_TX_MODE		|	/* output mode , PORT_DIR */
 			PPI_XFER_TYPE_11	|	/* sync mode XFR_TYPE */
 			PPI_PORT_CFG_01		|	/* two frame sync PORT_CFG */
 			PPI_PACK_EN		|	/* packing enabled PACK_EN */
-			PPI_POLS_1;			/* faling edge syncs POLS */
+			PPI_POLS_1			/* faling edge syncs POLS */
+	);
 }
 
 void Init_DMA(void *dst)
 {
-	*pDMA0_START_ADDR = dst;
+	bfin_write_DMA0_START_ADDR(dst);
 
 	/* X count */
-	*pDMA0_X_COUNT = H_ACTPIX / 2;
-	*pDMA0_X_MODIFY = DMA_BUS_SIZE / 8;
+	bfin_write_DMA0_X_COUNT(H_ACTPIX / 2);
+	bfin_write_DMA0_X_MODIFY(DMA_BUS_SIZE / 8);
 
 	/* Y count */
-	*pDMA0_Y_COUNT = V_LINES;
-	*pDMA0_Y_MODIFY = DMA_BUS_SIZE / 8;
+	bfin_write_DMA0_Y_COUNT(V_LINES);
+	bfin_write_DMA0_Y_MODIFY(DMA_BUS_SIZE / 8);
 
 	/* DMA Config */
-	*pDMA0_CONFIG =
+	bfin_write_DMA0_CONFIG(
 		WDSIZE_16	|	/* 16 bit DMA */
 		DMA2D 		|	/* 2D DMA */
-		FLOW_AUTO;		/* autobuffer mode */
+		FLOW_AUTO		/* autobuffer mode */
+	);
 }
 
-
 void EnableDMA(void)
 {
-	*pDMA0_CONFIG |= DMAEN;
+	bfin_write_DMA0_CONFIG(bfin_read_DMA0_CONFIG() | DMAEN);
 }
 
 void DisableDMA(void)
 {
-	*pDMA0_CONFIG &= ~DMAEN;
+	bfin_write_DMA0_CONFIG(bfin_read_DMA0_CONFIG() & ~DMAEN);
 }
 
-
 /* Init TIMER0 as Frame Sync 1 generator */
 void InitTIMER0(void)
 {
-	*pTIMER_DISABLE |= TIMDIS0;			/* disable Timer */
+	bfin_write_TIMER_DISABLE(TIMDIS0);			/* disable Timer */
 	SSYNC();
-	*pTIMER_STATUS  |= TIMIL0 | TOVF_ERR0 | TRUN0;	/* clear status */
+	bfin_write_TIMER_STATUS(TIMIL0 | TOVF_ERR0 | TRUN0);	/* clear status */
 	SSYNC();
 
-	*pTIMER0_PERIOD  = H_PERIOD;
+	bfin_write_TIMER0_PERIOD(H_PERIOD);
 	SSYNC();
-	*pTIMER0_WIDTH   = H_PULSE;
+	bfin_write_TIMER0_WIDTH(H_PULSE);
 	SSYNC();
 
-	*pTIMER0_CONFIG  = PWM_OUT |
+	bfin_write_TIMER0_CONFIG(
+				PWM_OUT |
 				PERIOD_CNT   |
 				TIN_SEL      |
 				CLK_SEL      |
-				EMU_RUN;
+				EMU_RUN
+	);
 	SSYNC();
 }
 
 void EnableTIMER0(void)
 {
-	*pTIMER_ENABLE  |= TIMEN0;
+	bfin_write_TIMER_ENABLE(TIMEN0);
 	SSYNC();
 }
 
 void DisableTIMER0(void)
 {
-	*pTIMER_DISABLE  |= TIMDIS0;
+	bfin_write_TIMER_DISABLE(TIMDIS0);
 	SSYNC();
 }
 
 
 void InitTIMER1(void)
 {
-	*pTIMER_DISABLE |= TIMDIS1;			/* disable Timer */
+	bfin_write_TIMER_DISABLE(TIMDIS1);			/* disable Timer */
 	SSYNC();
-	*pTIMER_STATUS  |= TIMIL1 | TOVF_ERR1 | TRUN1;	/* clear status */
+	bfin_write_TIMER_STATUS(TIMIL1 | TOVF_ERR1 | TRUN1);	/* clear status */
 	SSYNC();
 
-
-	*pTIMER1_PERIOD  = V_PERIOD;
+	bfin_write_TIMER1_PERIOD(V_PERIOD);
 	SSYNC();
-	*pTIMER1_WIDTH   = V_PULSE;
+	bfin_write_TIMER1_WIDTH(V_PULSE);
 	SSYNC();
 
-	*pTIMER1_CONFIG  = PWM_OUT |
+	bfin_write_TIMER1_CONFIG(
+				PWM_OUT |
 				PERIOD_CNT   |
 				TIN_SEL      |
 				CLK_SEL      |
-				EMU_RUN;
+				EMU_RUN
+	);
 	SSYNC();
 }
 
 void EnableTIMER1(void)
 {
-	*pTIMER_ENABLE  |= TIMEN1;
+	bfin_write_TIMER_ENABLE(TIMEN1);
 	SSYNC();
 }
 
 void DisableTIMER1(void)
 {
-	*pTIMER_DISABLE  |= TIMDIS1;
+	bfin_write_TIMER_DISABLE(TIMDIS1);
 	SSYNC();
 }
 
 void EnableTIMER12(void)
 {
-	*pTIMER_ENABLE |= TIMEN1 | TIMEN0;
+	bfin_write_TIMER_ENABLE(TIMEN1 | TIMEN0);
 	SSYNC();
 }
 
-- 
1.7.3.1

  parent reply	other threads:[~2010-10-02 20:05 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-02 20:05 [U-Boot] [PATCH 00/37] Blackfin updates for v2010.12-rc1 Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 03/37] Blackfin: bfin_spi: add optional DMA support Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 04/37] Blackfin: bfin_sdh: clean up send_cmd Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 05/37] Blackfin: unify gpio cfi implementations Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 06/37] Blackfin: punt headers for non-existent BF541 Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 07/37] Blackfin: bfin_mac: convert from old style MMR macros Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 08/37] Blackfin: bf537-stamp: post: update old MMR style macros Mike Frysinger
2010-10-02 20:05 ` Mike Frysinger [this message]
2010-10-02 20:05 ` [U-Boot] [PATCH 10/37] Blackfin: bf548-ezkit: video: convert from old style MMR macros Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 11/37] Blackfin: cm-bf548: " Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 12/37] Blackfin: bf527-ad7160-eval: " Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 14/37] Blackfin: bf537: unify arch header duplication Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 19/37] Blackfin: move CONFIG_BFIN_CPU to board config.mk Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 20/37] Blackfin: cmd_gpio: document/extend input sub-option Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 21/37] Blackfin: support a 3rd gpio cfi pin Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 22/37] Blackfin: adi config: add an "all spi flashes" option to unify board lists Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 23/37] Blackfin: adi config: add a hook for boards to append the env Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 24/37] Blackfin: bf527-sdp: new board port Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 25/37] Blackfin: cmd_gpio: return gpio value to caller Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 26/37] Blackfin: adi config: allow boards to tweak a little more Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 27/37] Blackfin: bct-brettl2: new board port Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 28/37] Blackfin: adi config: enable nand lock/unlock support Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 29/37] Blackfin: bf526-ezbrd: enable BootROM-OOB layout when booting from NAND Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 30/37] Blackfin: cmd_gpio: accept upper case pin names Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 31/37] Blackfin: propagate target cpu defines when building embedded env Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 32/37] Blackfin: blackvme: new board port Mike Frysinger
2010-10-03  1:52   ` Wojtek Skulski
2010-10-02 20:05 ` [U-Boot] [PATCH 33/37] Blackfin: fix MMC init output alignment Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 34/37] Blackfin: bf548-ezkit: bump SPI flash size up Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 35/37] Blackfin: bf527-ad7160-eval: fix GPIO CS define Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 36/37] Blackfin: bf537-pnav: increase monitor len Mike Frysinger
2010-10-02 20:05 ` [U-Boot] [PATCH 37/37] Blackfin: otp: fix build after constification of args[] Mike Frysinger
2010-10-04 17:33 ` [U-Boot] Pull request u-boot-blackfin.git Mike Frysinger
2010-10-05 12:43   ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1286049958-4125-8-git-send-email-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.