From owner-p4-projects@FreeBSD.ORG Tue May 26 19:28:01 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 56D15106567A; Tue, 26 May 2009 19:28:01 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1013A1065678 for ; Tue, 26 May 2009 19:28:01 +0000 (UTC) (envelope-from syl@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D52638FC1D for ; Tue, 26 May 2009 19:28:00 +0000 (UTC) (envelope-from syl@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n4QJS0TG023958 for ; Tue, 26 May 2009 19:28:00 GMT (envelope-from syl@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n4QJS0gL023956 for perforce@freebsd.org; Tue, 26 May 2009 19:28:00 GMT (envelope-from syl@FreeBSD.org) Date: Tue, 26 May 2009 19:28:00 GMT Message-Id: <200905261928.n4QJS0gL023956@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to syl@FreeBSD.org using -f From: Sylvestre Gallon To: Perforce Change Reviews Cc: Subject: PERFORCE change 162801 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2009 19:28:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=162801 Change 162801 by syl@syl_rincewind on 2009/05/26 19:27:58 Update pio code to be SoC independant. Affected files ... .. //depot/projects/soc2009/syl_usb/src/sys/arm/at91/at91_pio.c#2 edit Differences ... ==== //depot/projects/soc2009/syl_usb/src/sys/arm/at91/at91_pio.c#2 (text) ==== @@ -39,7 +39,7 @@ #include #include -#include +#include #include #include @@ -283,7 +283,7 @@ void at91_pio_use_periph_a(uint32_t pio, uint32_t periph_a_mask, int use_pullup) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(at91_base() + pio); PIO[PIO_ASR / 4] = periph_a_mask; PIO[PIO_PDR / 4] = periph_a_mask; @@ -296,7 +296,7 @@ void at91_pio_use_periph_b(uint32_t pio, uint32_t periph_b_mask, int use_pullup) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(at91_base() + pio); PIO[PIO_BSR / 4] = periph_b_mask; PIO[PIO_PDR / 4] = periph_b_mask; @@ -309,7 +309,7 @@ void at91_pio_use_gpio(uint32_t pio, uint32_t gpio_mask) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(at91_base() + pio); PIO[PIO_PER / 4] = gpio_mask; } @@ -317,7 +317,7 @@ void at91_pio_gpio_input(uint32_t pio, uint32_t input_enable_mask) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(at91_base() + pio); PIO[PIO_ODR / 4] = input_enable_mask; } @@ -325,7 +325,7 @@ void at91_pio_gpio_output(uint32_t pio, uint32_t output_enable_mask, int use_pullup) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(at91_base() + pio); PIO[PIO_OER / 4] = output_enable_mask; if (use_pullup) @@ -337,7 +337,7 @@ void at91_pio_gpio_set(uint32_t pio, uint32_t data_mask) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(at91_base() + pio); PIO[PIO_SODR / 4] = data_mask; } @@ -345,7 +345,7 @@ void at91_pio_gpio_clear(uint32_t pio, uint32_t data_mask) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(at91_base() + pio); PIO[PIO_CODR / 4] = data_mask; } @@ -353,7 +353,7 @@ uint8_t at91_pio_gpio_get(uint32_t pio, uint32_t data_mask) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(at91_base() + pio); data_mask &= PIO[PIO_PDSR / 4]; @@ -363,7 +363,7 @@ void at91_pio_gpio_set_deglitch(uint32_t pio, uint32_t data_mask, int use_deglitch) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(at91_base() + pio); if (use_deglitch) PIO[PIO_IFER / 4] = data_mask; @@ -376,7 +376,7 @@ at91_pio_gpio_set_interrupt(uint32_t pio, uint32_t data_mask, int enable_interrupt) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(at91_base() + pio); if (enable_interrupt) PIO[PIO_IER / 4] = data_mask; @@ -388,7 +388,7 @@ uint32_t at91_pio_gpio_clear_interrupt(uint32_t pio) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(at91_base() + pio); /* reading this register will clear the interrupts */ return (PIO[PIO_ISR / 4]); }