armadeus-commitlog Mailing List for armadeus (Page 128)
Brought to you by:
sszy
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(43) |
Feb
(8) |
Mar
(7) |
Apr
(8) |
May
(14) |
Jun
(6) |
Jul
(4) |
Aug
(17) |
Sep
(18) |
Oct
(19) |
Nov
(52) |
Dec
(30) |
| 2008 |
Jan
(6) |
Feb
(6) |
Mar
(15) |
Apr
(22) |
May
(13) |
Jun
(11) |
Jul
(41) |
Aug
(10) |
Sep
(14) |
Oct
(21) |
Nov
(4) |
Dec
(66) |
| 2009 |
Jan
(67) |
Feb
(57) |
Mar
(90) |
Apr
(54) |
May
(64) |
Jun
(76) |
Jul
(14) |
Aug
(18) |
Sep
(18) |
Oct
(20) |
Nov
(15) |
Dec
(36) |
| 2010 |
Jan
(28) |
Feb
(25) |
Mar
(32) |
Apr
(23) |
May
(22) |
Jun
(62) |
Jul
(36) |
Aug
(16) |
Sep
(12) |
Oct
(20) |
Nov
(44) |
Dec
(25) |
| 2011 |
Jan
(36) |
Feb
(49) |
Mar
(28) |
Apr
(38) |
May
(26) |
Jun
(52) |
Jul
(33) |
Aug
(32) |
Sep
(19) |
Oct
(26) |
Nov
(13) |
Dec
(32) |
| 2012 |
Jan
(38) |
Feb
(34) |
Mar
(91) |
Apr
(35) |
May
(31) |
Jun
(72) |
Jul
(23) |
Aug
(13) |
Sep
(33) |
Oct
(47) |
Nov
(18) |
Dec
(22) |
| 2013 |
Jan
(31) |
Feb
(22) |
Mar
(26) |
Apr
(11) |
May
(38) |
Jun
(15) |
Jul
(37) |
Aug
(68) |
Sep
(34) |
Oct
(11) |
Nov
(26) |
Dec
(31) |
| 2014 |
Jan
(60) |
Feb
(55) |
Mar
(21) |
Apr
(31) |
May
(17) |
Jun
(35) |
Jul
(24) |
Aug
(17) |
Sep
(11) |
Oct
(23) |
Nov
(10) |
Dec
(23) |
| 2015 |
Jan
(15) |
Feb
(34) |
Mar
(46) |
Apr
(23) |
May
(12) |
Jun
(14) |
Jul
(18) |
Aug
(22) |
Sep
(6) |
Oct
(2) |
Nov
(1) |
Dec
(6) |
| 2016 |
Jan
(5) |
Feb
(7) |
Mar
(10) |
Apr
(10) |
May
(17) |
Jun
(6) |
Jul
(4) |
Aug
(6) |
Sep
(22) |
Oct
(8) |
Nov
(9) |
Dec
(5) |
| 2017 |
Jan
(11) |
Feb
(12) |
Mar
(27) |
Apr
(9) |
May
(1) |
Jun
(5) |
Jul
(11) |
Aug
(10) |
Sep
(6) |
Oct
(10) |
Nov
(4) |
Dec
(6) |
| 2018 |
Jan
(6) |
Feb
(13) |
Mar
(9) |
Apr
(7) |
May
(10) |
Jun
(9) |
Jul
(21) |
Aug
(13) |
Sep
(10) |
Oct
(4) |
Nov
(6) |
Dec
(1) |
| 2019 |
Jan
(6) |
Feb
(2) |
Mar
(5) |
Apr
(6) |
May
(19) |
Jun
(14) |
Jul
(18) |
Aug
(3) |
Sep
(5) |
Oct
(7) |
Nov
(8) |
Dec
(4) |
| 2020 |
Jan
(10) |
Feb
(3) |
Mar
(9) |
Apr
(7) |
May
(2) |
Jun
(18) |
Jul
(3) |
Aug
|
Sep
|
Oct
(7) |
Nov
|
Dec
(1) |
| 2021 |
Jan
(9) |
Feb
(6) |
Mar
(4) |
Apr
(11) |
May
(7) |
Jun
(5) |
Jul
(2) |
Aug
(4) |
Sep
(10) |
Oct
(9) |
Nov
(5) |
Dec
|
| 2022 |
Jan
(2) |
Feb
(12) |
Mar
(3) |
Apr
(5) |
May
(1) |
Jun
(3) |
Jul
(2) |
Aug
(1) |
Sep
(4) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
| 2023 |
Jan
(5) |
Feb
(3) |
Mar
(3) |
Apr
(2) |
May
(1) |
Jun
(3) |
Jul
(3) |
Aug
(2) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(4) |
| 2024 |
Jan
(2) |
Feb
(3) |
Mar
(8) |
Apr
(4) |
May
(1) |
Jun
(13) |
Jul
(7) |
Aug
(1) |
Sep
(6) |
Oct
(5) |
Nov
(11) |
Dec
(7) |
| 2025 |
Jan
(3) |
Feb
(1) |
Mar
(6) |
Apr
(4) |
May
(4) |
Jun
(1) |
Jul
(1) |
Aug
(7) |
Sep
(4) |
Oct
(4) |
Nov
(4) |
Dec
(1) |
| 2026 |
Jan
(3) |
Feb
(7) |
Mar
(3) |
Apr
(1) |
May
(6) |
Jun
(3) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <Fa...@us...> - 2009-03-12 17:56:33
|
Revision: 1156
http://armadeus.svn.sourceforge.net/armadeus/?rev=1156&view=rev
Author: FabM
Date: 2009-03-12 17:56:09 +0000 (Thu, 12 Mar 2009)
Log Message:
-----------
[FIRMWARE] Adding bitstream for wishbone example apf27 and apf9328
Added Paths:
-----------
trunk/firmware/wishbone_example/bin/
trunk/firmware/wishbone_example/bin/wishbone_example_xc3s200.bit
trunk/firmware/wishbone_example/bin/wishbone_example_xc3s200a.bit
trunk/firmware/wishbone_example/bin/wishbone_example_xc3s400.bit
trunk/firmware/wishbone_example/bin/wishbone_example_xc3s400a.bit
Added: trunk/firmware/wishbone_example/bin/wishbone_example_xc3s200.bit
===================================================================
(Binary files differ)
Property changes on: trunk/firmware/wishbone_example/bin/wishbone_example_xc3s200.bit
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/firmware/wishbone_example/bin/wishbone_example_xc3s200a.bit
===================================================================
(Binary files differ)
Property changes on: trunk/firmware/wishbone_example/bin/wishbone_example_xc3s200a.bit
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/firmware/wishbone_example/bin/wishbone_example_xc3s400.bit
===================================================================
(Binary files differ)
Property changes on: trunk/firmware/wishbone_example/bin/wishbone_example_xc3s400.bit
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/firmware/wishbone_example/bin/wishbone_example_xc3s400a.bit
===================================================================
(Binary files differ)
Property changes on: trunk/firmware/wishbone_example/bin/wishbone_example_xc3s400a.bit
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Fa...@us...> - 2009-03-12 16:26:17
|
Revision: 1155
http://armadeus.svn.sourceforge.net/armadeus/?rev=1155&view=rev
Author: FabM
Date: 2009-03-12 16:25:53 +0000 (Thu, 12 Mar 2009)
Log Message:
-----------
[FIRMWARE] Updating wishbone example to be compatible with apf27
Modified Paths:
--------------
trunk/firmware/wishbone_example/Makefile
trunk/firmware/wishbone_example/src/button.vhd
trunk/firmware/wishbone_example/src/led.vhd
trunk/firmware/wishbone_example/src/top_wishbone_example.vhd
trunk/firmware/wishbone_example/testbench/top_wishbone_example_tb.vhd
Added Paths:
-----------
trunk/firmware/wishbone_example/intercon.odg
trunk/firmware/wishbone_example/src/intercon.vhd
trunk/firmware/wishbone_example/src/wishbone_example_apf27.ucf
trunk/firmware/wishbone_example/src/wishbone_example_apf9328.ucf
trunk/firmware/wishbone_example/src/wishbone_wrapper.vhd
trunk/firmware/wishbone_example/wb_buttonled.odg
Removed Paths:
-------------
trunk/firmware/wishbone_example/src/imx9328_wb16_wrapper.vhd
trunk/firmware/wishbone_example/src/imx9328_wb16_wrapper00_mwb16_intercon.vhd
trunk/firmware/wishbone_example/src/wishbone_example.ucf
Modified: trunk/firmware/wishbone_example/Makefile
===================================================================
--- trunk/firmware/wishbone_example/Makefile 2009-03-12 16:03:28 UTC (rev 1154)
+++ trunk/firmware/wishbone_example/Makefile 2009-03-12 16:25:53 UTC (rev 1155)
@@ -11,12 +11,12 @@
SYNTHESIS_FILE=$(PROJECT)_synthesis.vhd
PLACE_AND_ROUTE_FILE=$(PROJECT)_timesim.vhd
FILES=src/top_wishbone_example.vhd \
- src/imx9328_wb16_wrapper.vhd \
+ src/wishbone_wrapper.vhd \
src/rstgen_syscon.vhd \
src/irq_mngr.vhd \
src/led.vhd \
src/button.vhd \
- src/imx9328_wb16_wrapper00_mwb16_intercon.vhd \
+ src/intercon.vhd \
testbench/apf_test_pkg.vhd
# testbench
Added: trunk/firmware/wishbone_example/intercon.odg
===================================================================
(Binary files differ)
Property changes on: trunk/firmware/wishbone_example/intercon.odg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/firmware/wishbone_example/src/button.vhd
===================================================================
--- trunk/firmware/wishbone_example/src/button.vhd 2009-03-12 16:03:28 UTC (rev 1154)
+++ trunk/firmware/wishbone_example/src/button.vhd 2009-03-12 16:25:53 UTC (rev 1155)
@@ -34,7 +34,7 @@
-- irq
irq : out std_logic ;
-- fpga input
- button : in std_logic
+ button_i : in std_logic
);
end entity;
@@ -52,7 +52,7 @@
if gls_reset = '1' then
reg <= (others => '0');
elsif rising_edge(gls_clk) then
- reg <= "000000000000000"&button;
+ reg <= "000000000000000"&button_i;
end if;
end process cbutton;
@@ -64,12 +64,12 @@
irq <= '0';
button_r <= '0';
elsif rising_edge(gls_clk) then
- if button_r /= button then
+ if button_r /= button_i then
irq <= '1';
else
irq <= '0';
end if;
- button_r <= button;
+ button_r <= button_i;
end if;
end process pbutton;
Deleted: trunk/firmware/wishbone_example/src/imx9328_wb16_wrapper.vhd
===================================================================
--- trunk/firmware/wishbone_example/src/imx9328_wb16_wrapper.vhd 2009-03-12 16:03:28 UTC (rev 1154)
+++ trunk/firmware/wishbone_example/src/imx9328_wb16_wrapper.vhd 2009-03-12 16:25:53 UTC (rev 1155)
@@ -1,95 +0,0 @@
--------------------------------------------------------------------------------
---
--- File : imx9328_wb16_wrapper.vhd
--- Related files : (none)
---
--- Author(s) : Fabrice Mousset (fab...@la...)
--- Project : i.MX wrapper to Wishbone bus
---
--- Creation Date : 2007/01/19
---
--- Description : This is the top file of the IP
--------------------------------------------------------------------------------
--- Modifications :
------
--- 2008/03/05
--- Fabien Marteau (fab...@ar...)
--- adding comments and changing some signals names
---
--------------------------------------------------------------------------------
-
-library IEEE;
- use IEEE.std_logic_1164.all;
- use IEEE.numeric_std.all;
-
--- ----------------------------------------------------------------------------
- Entity imx9328_wb16_wrapper is
--- ----------------------------------------------------------------------------
- port
- (
- -- i.MX Signals
- imx_address : in std_logic_vector(11 downto 0); -- LSB not used
- imx_data : inout std_logic_vector(15 downto 0);
- imx_cs_n : in std_logic;
- imx_oe_n : in std_logic;
- imx_eb3_n : in std_logic;
-
- -- Global Signals
- gls_reset : in std_logic;
- gls_clk : in std_logic;
-
- -- Interrupt out for write error
--- int_err : out std_logic;
-
- -- Wishbone interface signals
- wbm_address : out std_logic_vector(12 downto 0); -- Address bus
- wbm_readdata : in std_logic_vector(15 downto 0); -- Data bus for read access
- wbm_writedata : out std_logic_vector(15 downto 0); -- Data bus for write access
- wbm_strobe : out std_logic; -- Data Strobe
- wbm_write : out std_logic; -- Write access
- wbm_ack : in std_logic ; -- acknowledge
- wbm_cycle : out std_logic -- bus cycle in progress
- );
- end entity;
-
--- ----------------------------------------------------------------------------
- Architecture RTL of imx9328_wb16_wrapper is
--- ----------------------------------------------------------------------------
-
-signal write : std_logic;
-signal read : std_logic;
-signal strobe : std_logic;
-signal writedata : std_logic_vector(15 downto 0);
-signal address : std_logic_vector(12 downto 0);
-
-begin
-
--- ----------------------------------------------------------------------------
--- External signals synchronization process
--- ----------------------------------------------------------------------------
-process(gls_clk, gls_reset)
-begin
- if(gls_reset='1') then
- write <= '0';
- read <= '0';
- strobe <= '0';
- writedata <= (others => '0');
- address <= (others => '0');
- elsif(rising_edge(gls_clk)) then
- strobe <= not (imx_cs_n) and not(imx_oe_n and imx_eb3_n);
- write <= not (imx_cs_n or imx_eb3_n);
- read <= not (imx_cs_n or imx_oe_n);
- address <= imx_address & '0';
- writedata <= imx_data;
- end if;
-end process;
-
-wbm_address <= address when (strobe = '1') else (others => '0');
-wbm_writedata <= writedata when (write = '1') else (others => '0');
-wbm_strobe <= strobe;
-wbm_write <= write;
-wbm_cycle <= strobe;
-
-imx_data <= wbm_readdata when(read = '1' ) else (others => 'Z');
-
-end architecture RTL;
Deleted: trunk/firmware/wishbone_example/src/imx9328_wb16_wrapper00_mwb16_intercon.vhd
===================================================================
--- trunk/firmware/wishbone_example/src/imx9328_wb16_wrapper00_mwb16_intercon.vhd 2009-03-12 16:03:28 UTC (rev 1154)
+++ trunk/firmware/wishbone_example/src/imx9328_wb16_wrapper00_mwb16_intercon.vhd 2009-03-12 16:25:53 UTC (rev 1155)
@@ -1,168 +0,0 @@
----------------------------------------------------------------------------
--- Company : Automaticaly generated by POD
--- Author(s) :
---
--- Creation Date : 2009-03-03
--- File : imx9328_wb16_wrapper00_mwb16.vhd
---
--- Abstract :
--- Connect slaves to mwb16 from imx9328_wb16_wrapper00
---
----------------------------------------------------------------------------
-
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.numeric_std.all;
-
-Entity imx9328_wb16_wrapper00_mwb16 is
- port
- (
-
- -- irq_mngr00_swb16 connection
- irq_mngr00_wbs_s1_address : out std_logic_vector(1 downto 0);
- irq_mngr00_wbs_s1_readdata : in std_logic_vector(15 downto 0);
- irq_mngr00_wbs_s1_writedata : out std_logic_vector(15 downto 0);
- irq_mngr00_wbs_s1_ack : in std_logic;
- irq_mngr00_wbs_s1_strobe : out std_logic;
- irq_mngr00_wbs_s1_cycle : out std_logic;
- irq_mngr00_wbs_s1_write : out std_logic;
-
- -- irq_mngr00_candr connection
- irq_mngr00_gls_clk : out std_logic;
- irq_mngr00_gls_reset : out std_logic;
-
- -- led0_swb16 connection
- led0_wbs_add : out std_logic;
- led0_wbs_writedata : out std_logic_vector(15 downto 0);
- led0_wbs_readdata : in std_logic_vector(15 downto 0);
- led0_wbs_strobe : out std_logic;
- led0_wbs_cycle : out std_logic;
- led0_wbs_write : out std_logic;
- led0_wbs_ack : in std_logic;
-
- -- led0_candr connection
- led0_gls_reset : out std_logic;
- led0_gls_clk : out std_logic;
-
- -- button0_swb16 connection
- button0_wbs_add : out std_logic;
- button0_wbs_readdata : in std_logic_vector(15 downto 0);
- button0_wbs_strobe : out std_logic;
- button0_wbs_write : out std_logic;
- button0_wbs_ack : in std_logic;
- button0_wbs_cycle : out std_logic;
-
- -- button0_candr connection
- button0_gls_reset : out std_logic;
- button0_gls_clk : out std_logic;
-
- -- imx9328_wb16_wrapper00_mwb16 connection
- imx9328_wb16_wrapper00_wbm_address : in std_logic_vector(12 downto 0);
- imx9328_wb16_wrapper00_wbm_readdata : out std_logic_vector(15 downto 0);
- imx9328_wb16_wrapper00_wbm_writedata : in std_logic_vector(15 downto 0);
- imx9328_wb16_wrapper00_wbm_strobe : in std_logic;
- imx9328_wb16_wrapper00_wbm_write : in std_logic;
- imx9328_wb16_wrapper00_wbm_ack : out std_logic;
- imx9328_wb16_wrapper00_wbm_cycle : in std_logic;
-
- -- imx9328_wb16_wrapper00_candr connection
- imx9328_wb16_wrapper00_gls_reset : out std_logic;
- imx9328_wb16_wrapper00_gls_clk : out std_logic;
-
- -- rstgen_syscon00_imx9328_wb16_wrapper00 connection
- rstgen_syscon00_gls_clk : in std_logic;
- rstgen_syscon00_gls_reset : in std_logic
- );
-end entity;
-
-architecture imx9328_wb16_wrapper00_mwb16_1 of imx9328_wb16_wrapper00_mwb16 is
- signal irq_mngr00_swb16_cs : std_logic := '0' ;
- signal led0_swb16_cs : std_logic := '0' ;
- signal button0_swb16_cs : std_logic := '0' ;
-begin
-
- -- Clock and Reset connection
- irq_mngr00_gls_clk <= rstgen_syscon00_gls_clk;
- irq_mngr00_gls_reset <= rstgen_syscon00_gls_reset;
-
- led0_gls_reset <= rstgen_syscon00_gls_reset;
- led0_gls_clk <= rstgen_syscon00_gls_clk;
-
- button0_gls_reset <= rstgen_syscon00_gls_reset;
- button0_gls_clk <= rstgen_syscon00_gls_clk;
-
- imx9328_wb16_wrapper00_gls_reset <= rstgen_syscon00_gls_reset;
- imx9328_wb16_wrapper00_gls_clk <= rstgen_syscon00_gls_clk;
-
-
- -- Address decoding --
- -----------------------
- irq_mngr00_wbs_s1_address <= imx9328_wb16_wrapper00_wbm_address(2 downto 1);
- led0_wbs_add <= imx9328_wb16_wrapper00_wbm_address(1);
- button0_wbs_add <= imx9328_wb16_wrapper00_wbm_address(1);
-
- decodeproc : process(rstgen_syscon00_gls_clk,rstgen_syscon00_gls_reset,imx9328_wb16_wrapper00_wbm_address)
- begin
- if rstgen_syscon00_gls_reset='1' then
- irq_mngr00_swb16_cs <= '0';
- led0_swb16_cs <= '0';
- button0_swb16_cs <= '0';
- elsif rising_edge(rstgen_syscon00_gls_clk) then
-
- if imx9328_wb16_wrapper00_wbm_address(12 downto 3)="0000000000" and imx9328_wb16_wrapper00_wbm_strobe='1' then
- irq_mngr00_swb16_cs <= '1';
- else
- irq_mngr00_swb16_cs <= '0';
- end if;
-
- if imx9328_wb16_wrapper00_wbm_address(12 downto 2)="00000000010" and imx9328_wb16_wrapper00_wbm_strobe='1' then
- led0_swb16_cs <= '1';
- else
- led0_swb16_cs <= '0';
- end if;
-
- if imx9328_wb16_wrapper00_wbm_address(12 downto 2)="00000000011" and imx9328_wb16_wrapper00_wbm_strobe='1' then
- button0_swb16_cs <= '1';
- else
- button0_swb16_cs <= '0';
- end if;
-
- end if;
- end process decodeproc;
-
- -----------------------------
- -- Control signals to slave
- -----------------------------
-
- -- for irq_mngr00
- irq_mngr00_wbs_s1_strobe <= (imx9328_wb16_wrapper00_wbm_strobe and irq_mngr00_swb16_cs );
- irq_mngr00_wbs_s1_cycle <= (imx9328_wb16_wrapper00_wbm_cycle and irq_mngr00_swb16_cs );
- irq_mngr00_wbs_s1_write <= (imx9328_wb16_wrapper00_wbm_write and irq_mngr00_swb16_cs );
- irq_mngr00_wbs_s1_writedata <= imx9328_wb16_wrapper00_wbm_writedata when (imx9328_wb16_wrapper00_wbm_write and irq_mngr00_swb16_cs ) = '1' else (others => '0');
-
- -- for led0
- led0_wbs_strobe <= (imx9328_wb16_wrapper00_wbm_strobe and led0_swb16_cs );
- led0_wbs_cycle <= (imx9328_wb16_wrapper00_wbm_cycle and led0_swb16_cs );
- led0_wbs_write <= (imx9328_wb16_wrapper00_wbm_write and led0_swb16_cs );
- led0_wbs_writedata <= imx9328_wb16_wrapper00_wbm_writedata when (imx9328_wb16_wrapper00_wbm_write and led0_swb16_cs ) = '1' else (others => '0');
-
- -- for button0
- button0_wbs_strobe <= (imx9328_wb16_wrapper00_wbm_strobe and button0_swb16_cs );
- button0_wbs_cycle <= (imx9328_wb16_wrapper00_wbm_cycle and button0_swb16_cs );
- button0_wbs_write <= '0';
-
-
- -------------------------------
- -- Control signal for master --
- -------------------------------
- imx9328_wb16_wrapper00_wbm_readdata <= irq_mngr00_wbs_s1_readdata when irq_mngr00_swb16_cs='1' else
- led0_wbs_readdata when led0_swb16_cs='1' else
- button0_wbs_readdata when button0_swb16_cs='1' else
- (others => '0');
- imx9328_wb16_wrapper00_wbm_ack <= (irq_mngr00_wbs_s1_ack and irq_mngr00_swb16_cs)
- or
- (led0_wbs_ack and led0_swb16_cs)
- or
- (button0_wbs_ack and button0_swb16_cs);
-
-end architecture imx9328_wb16_wrapper00_mwb16_1;
Copied: trunk/firmware/wishbone_example/src/intercon.vhd (from rev 1108, trunk/firmware/wishbone_example/src/imx9328_wb16_wrapper00_mwb16_intercon.vhd)
===================================================================
--- trunk/firmware/wishbone_example/src/intercon.vhd (rev 0)
+++ trunk/firmware/wishbone_example/src/intercon.vhd 2009-03-12 16:25:53 UTC (rev 1155)
@@ -0,0 +1,168 @@
+---------------------------------------------------------------------------
+-- Company : Automaticaly generated by POD
+-- Author(s) :
+--
+-- Creation Date : 2009-03-03
+-- File : intercon.vhd
+--
+-- Abstract :
+-- Connect slaves to mwb16 from wrapper
+--
+---------------------------------------------------------------------------
+
+library IEEE;
+use IEEE.STD_LOGIC_1164.ALL;
+use IEEE.numeric_std.all;
+
+Entity intercon is
+ port
+ (
+
+ -- irq_mngr00_swb16 connection
+ irq_mngr00_wbs_s1_address : out std_logic_vector(1 downto 0);
+ irq_mngr00_wbs_s1_readdata : in std_logic_vector(15 downto 0);
+ irq_mngr00_wbs_s1_writedata : out std_logic_vector(15 downto 0);
+ irq_mngr00_wbs_s1_ack : in std_logic;
+ irq_mngr00_wbs_s1_strobe : out std_logic;
+ irq_mngr00_wbs_s1_cycle : out std_logic;
+ irq_mngr00_wbs_s1_write : out std_logic;
+
+ -- irq_mngr00_candr connection
+ irq_mngr00_gls_clk : out std_logic;
+ irq_mngr00_gls_reset : out std_logic;
+
+ -- led0_swb16 connection
+ led0_wbs_add : out std_logic;
+ led0_wbs_writedata : out std_logic_vector(15 downto 0);
+ led0_wbs_readdata : in std_logic_vector(15 downto 0);
+ led0_wbs_strobe : out std_logic;
+ led0_wbs_cycle : out std_logic;
+ led0_wbs_write : out std_logic;
+ led0_wbs_ack : in std_logic;
+
+ -- led0_candr connection
+ led0_gls_reset : out std_logic;
+ led0_gls_clk : out std_logic;
+
+ -- button0_swb16 connection
+ button0_wbs_add : out std_logic;
+ button0_wbs_readdata : in std_logic_vector(15 downto 0);
+ button0_wbs_strobe : out std_logic;
+ button0_wbs_write : out std_logic;
+ button0_wbs_ack : in std_logic;
+ button0_wbs_cycle : out std_logic;
+
+ -- button0_candr connection
+ button0_gls_reset : out std_logic;
+ button0_gls_clk : out std_logic;
+
+ -- intercon connection
+ wrapper_wbm_address : in std_logic_vector(12 downto 0);
+ wrapper_wbm_readdata : out std_logic_vector(15 downto 0);
+ wrapper_wbm_writedata : in std_logic_vector(15 downto 0);
+ wrapper_wbm_strobe : in std_logic;
+ wrapper_wbm_write : in std_logic;
+ wrapper_wbm_ack : out std_logic;
+ wrapper_wbm_cycle : in std_logic;
+
+ -- wrapper_candr connection
+ wrapper_gls_reset : out std_logic;
+ wrapper_gls_clk : out std_logic;
+
+ -- rstgen_syscon00_wrapper connection
+ rstgen_syscon00_gls_clk : in std_logic;
+ rstgen_syscon00_gls_reset : in std_logic
+ );
+end entity;
+
+architecture intercon_1 of intercon is
+ signal irq_mngr00_swb16_cs : std_logic := '0' ;
+ signal led0_swb16_cs : std_logic := '0' ;
+ signal button0_swb16_cs : std_logic := '0' ;
+begin
+
+ -- Clock and Reset connection
+ irq_mngr00_gls_clk <= rstgen_syscon00_gls_clk;
+ irq_mngr00_gls_reset <= rstgen_syscon00_gls_reset;
+
+ led0_gls_reset <= rstgen_syscon00_gls_reset;
+ led0_gls_clk <= rstgen_syscon00_gls_clk;
+
+ button0_gls_reset <= rstgen_syscon00_gls_reset;
+ button0_gls_clk <= rstgen_syscon00_gls_clk;
+
+ wrapper_gls_reset <= rstgen_syscon00_gls_reset;
+ wrapper_gls_clk <= rstgen_syscon00_gls_clk;
+
+
+ -- Address decoding --
+ -----------------------
+ irq_mngr00_wbs_s1_address <= wrapper_wbm_address(2 downto 1);
+ led0_wbs_add <= wrapper_wbm_address(1);
+ button0_wbs_add <= wrapper_wbm_address(1);
+
+ decodeproc : process(rstgen_syscon00_gls_clk,rstgen_syscon00_gls_reset,wrapper_wbm_address)
+ begin
+ if rstgen_syscon00_gls_reset='1' then
+ irq_mngr00_swb16_cs <= '0';
+ led0_swb16_cs <= '0';
+ button0_swb16_cs <= '0';
+ elsif rising_edge(rstgen_syscon00_gls_clk) then
+
+ if wrapper_wbm_address(12 downto 3)="0000000000" and wrapper_wbm_strobe='1' then
+ irq_mngr00_swb16_cs <= '1';
+ else
+ irq_mngr00_swb16_cs <= '0';
+ end if;
+
+ if wrapper_wbm_address(12 downto 2)="00000000010" and wrapper_wbm_strobe='1' then
+ led0_swb16_cs <= '1';
+ else
+ led0_swb16_cs <= '0';
+ end if;
+
+ if wrapper_wbm_address(12 downto 2)="00000000011" and wrapper_wbm_strobe='1' then
+ button0_swb16_cs <= '1';
+ else
+ button0_swb16_cs <= '0';
+ end if;
+
+ end if;
+ end process decodeproc;
+
+ -----------------------------
+ -- Control signals to slave
+ -----------------------------
+
+ -- for irq_mngr00
+ irq_mngr00_wbs_s1_strobe <= (wrapper_wbm_strobe and irq_mngr00_swb16_cs );
+ irq_mngr00_wbs_s1_cycle <= (wrapper_wbm_cycle and irq_mngr00_swb16_cs );
+ irq_mngr00_wbs_s1_write <= (wrapper_wbm_write and irq_mngr00_swb16_cs );
+ irq_mngr00_wbs_s1_writedata <= wrapper_wbm_writedata when (wrapper_wbm_write and irq_mngr00_swb16_cs ) = '1' else (others => '0');
+
+ -- for led0
+ led0_wbs_strobe <= (wrapper_wbm_strobe and led0_swb16_cs );
+ led0_wbs_cycle <= (wrapper_wbm_cycle and led0_swb16_cs );
+ led0_wbs_write <= (wrapper_wbm_write and led0_swb16_cs );
+ led0_wbs_writedata <= wrapper_wbm_writedata when (wrapper_wbm_write and led0_swb16_cs ) = '1' else (others => '0');
+
+ -- for button0
+ button0_wbs_strobe <= (wrapper_wbm_strobe and button0_swb16_cs );
+ button0_wbs_cycle <= (wrapper_wbm_cycle and button0_swb16_cs );
+ button0_wbs_write <= '0';
+
+
+ -------------------------------
+ -- Control signal for master --
+ -------------------------------
+ wrapper_wbm_readdata <= irq_mngr00_wbs_s1_readdata when irq_mngr00_swb16_cs='1' else
+ led0_wbs_readdata when led0_swb16_cs='1' else
+ button0_wbs_readdata when button0_swb16_cs='1' else
+ (others => '0');
+ wrapper_wbm_ack <= (irq_mngr00_wbs_s1_ack and irq_mngr00_swb16_cs)
+ or
+ (led0_wbs_ack and led0_swb16_cs)
+ or
+ (button0_wbs_ack and button0_swb16_cs);
+
+end architecture intercon_1;
Modified: trunk/firmware/wishbone_example/src/led.vhd
===================================================================
--- trunk/firmware/wishbone_example/src/led.vhd 2009-03-12 16:03:28 UTC (rev 1154)
+++ trunk/firmware/wishbone_example/src/led.vhd 2009-03-12 16:25:53 UTC (rev 1155)
@@ -34,7 +34,7 @@
wbs_write : in std_logic ;
wbs_ack : out std_logic;
-- out signals
- led : out std_logic
+ led_o : out std_logic
);
end entity led;
@@ -45,8 +45,8 @@
signal reg : std_logic_vector( wb_size-1 downto 0);
begin
--- connect led
-led <= reg(0);
+-- connect led_o
+led_o <= reg(0);
wbs_ack <= wbs_strobe;
Modified: trunk/firmware/wishbone_example/src/top_wishbone_example.vhd
===================================================================
--- trunk/firmware/wishbone_example/src/top_wishbone_example.vhd 2009-03-12 16:03:28 UTC (rev 1154)
+++ trunk/firmware/wishbone_example/src/top_wishbone_example.vhd 2009-03-12 16:25:53 UTC (rev 1155)
@@ -18,15 +18,15 @@
port
(
- imx9328_wb16_wrapper00_imx_data : inout std_logic_vector(15 downto 0);
- imx9328_wb16_wrapper00_imx_address : in std_logic_vector(11 downto 0);
- rstgen_syscon00_ext_clk : in std_logic;
- imx9328_wb16_wrapper00_imx_cs_n : in std_logic;
- imx9328_wb16_wrapper00_imx_eb3_n : in std_logic;
- imx9328_wb16_wrapper00_imx_oe_n : in std_logic;
- irq_mngr00_gls_irq : out std_logic;
- led0_led : out std_logic;
- button0_button : in std_logic
+ imx_data : inout std_logic_vector(15 downto 0);
+ imx_address : in std_logic_vector(11 downto 0);
+ ext_clk : in std_logic;
+ imx_cs_n : in std_logic;
+ imx_eb3_n : in std_logic;
+ imx_oe_n : in std_logic;
+ gls_irq : out std_logic;
+ led_o : out std_logic;
+ button_i : in std_logic
);
end entity top_wishbone_example;
@@ -53,7 +53,7 @@
);
port (
-- int_led
- led : out std_logic;
+ led_o : out std_logic;
-- candr
gls_reset : in std_logic;
gls_clk : in std_logic;
@@ -74,7 +74,7 @@
);
port (
-- int_button
- button : in std_logic;
+ button_i : in std_logic;
irq : out std_logic;
-- candr
gls_reset : in std_logic;
@@ -89,24 +89,24 @@
);
end component;
- component imx9328_wb16_wrapper
+ component wishbone_wrapper
port (
-- eim
imx_address : in std_logic_vector(11 downto 0);
- imx_data : inout std_logic_vector(15 downto 0);
- imx_cs_n : in std_logic;
- imx_oe_n : in std_logic;
+ imx_data : inout std_logic_vector(15 downto 0);
+ imx_cs_n : in std_logic;
+ imx_oe_n : in std_logic;
imx_eb3_n : in std_logic;
-- candr
- gls_reset : in std_logic;
- gls_clk : in std_logic;
+ gls_reset : in std_logic;
+ gls_clk : in std_logic;
-- mwb16
wbm_address : out std_logic_vector(12 downto 0);
- wbm_readdata : in std_logic_vector(15 downto 0);
- wbm_writedata : out std_logic_vector(15 downto 0);
- wbm_strobe : out std_logic;
+ wbm_readdata : in std_logic_vector(15 downto 0);
+ wbm_writedata: out std_logic_vector(15 downto 0);
+ wbm_strobe : out std_logic;
wbm_write : out std_logic;
- wbm_ack : in std_logic;
+ wbm_ack : in std_logic;
wbm_cycle : out std_logic
);
end component;
@@ -136,7 +136,7 @@
);
end component;
- component imx9328_wb16_wrapper00_mwb16
+ component intercon
port (
-- irq_mngr00_swb16
irq_mngr00_wbs_s1_address : out std_logic_vector(1 downto 0);
@@ -170,18 +170,18 @@
-- button0_candr
button0_gls_reset : out std_logic;
button0_gls_clk : out std_logic;
- -- imx9328_wb16_wrapper00_mwb16
- imx9328_wb16_wrapper00_wbm_address : in std_logic_vector(12 downto 0);
- imx9328_wb16_wrapper00_wbm_readdata : out std_logic_vector(15 downto 0);
- imx9328_wb16_wrapper00_wbm_writedata : in std_logic_vector(15 downto 0);
- imx9328_wb16_wrapper00_wbm_strobe : in std_logic;
- imx9328_wb16_wrapper00_wbm_write : in std_logic;
- imx9328_wb16_wrapper00_wbm_ack : out std_logic;
- imx9328_wb16_wrapper00_wbm_cycle : in std_logic;
- -- imx9328_wb16_wrapper00_candr
- imx9328_wb16_wrapper00_gls_reset : out std_logic;
- imx9328_wb16_wrapper00_gls_clk : out std_logic;
- -- rstgen_syscon00_imx9328_wb16_wrapper00
+ -- wrapper
+ wrapper_wbm_address : in std_logic_vector(12 downto 0);
+ wrapper_wbm_readdata : out std_logic_vector(15 downto 0);
+ wrapper_wbm_writedata : in std_logic_vector(15 downto 0);
+ wrapper_wbm_strobe : in std_logic;
+ wrapper_wbm_write : in std_logic;
+ wrapper_wbm_ack : out std_logic;
+ wrapper_wbm_cycle : in std_logic;
+ -- wrapper_candr
+ wrapper_gls_reset : out std_logic;
+ wrapper_gls_clk : out std_logic;
+ -- rstgen_syscon00_wrapper
rstgen_syscon00_gls_clk : in std_logic;
rstgen_syscon00_gls_reset : in std_logic
);
@@ -190,153 +190,90 @@
-- Signals declaration
-------------------------
- -- imx9328_wb16_wrapper00
- -- eim
- -- candr
- signal imx9328_wb16_wrapper00_gls_reset : std_logic;
- signal imx9328_wb16_wrapper00_gls_clk : std_logic;
- -- mwb16
- signal imx9328_wb16_wrapper00_wbm_address : std_logic_vector(12 downto 0);
- signal imx9328_wb16_wrapper00_wbm_readdata : std_logic_vector(15 downto 0);
- signal imx9328_wb16_wrapper00_wbm_writedata : std_logic_vector(15 downto 0);
- signal imx9328_wb16_wrapper00_wbm_strobe : std_logic;
- signal imx9328_wb16_wrapper00_wbm_write : std_logic;
- signal imx9328_wb16_wrapper00_wbm_ack : std_logic;
- signal imx9328_wb16_wrapper00_wbm_cycle : std_logic;
-
- -- rstgen_syscon00
- -- candr
- signal rstgen_syscon00_gls_clk : std_logic;
- signal rstgen_syscon00_gls_reset : std_logic;
- -- clk_ext
-
- -- irq_mngr00
- -- candr
- signal irq_mngr00_gls_clk : std_logic;
- signal irq_mngr00_gls_reset : std_logic;
- -- swb16
- signal irq_mngr00_wbs_s1_address : std_logic_vector(1 downto 0);
- signal irq_mngr00_wbs_s1_readdata : std_logic_vector(15 downto 0);
- signal irq_mngr00_wbs_s1_writedata : std_logic_vector(15 downto 0);
- signal irq_mngr00_wbs_s1_ack : std_logic;
- signal irq_mngr00_wbs_s1_strobe : std_logic;
- signal irq_mngr00_wbs_s1_cycle : std_logic;
- signal irq_mngr00_wbs_s1_write : std_logic;
- -- irq
- signal irq_mngr00_irqport : std_logic_vector(0 downto 0);
- -- ext_irq
-
- -- led0
- -- int_led
- -- candr
- signal led0_gls_reset : std_logic;
- signal led0_gls_clk : std_logic;
- -- swb16
- signal led0_wbs_add : std_logic;
- signal led0_wbs_writedata : std_logic_vector(15 downto 0);
- signal led0_wbs_readdata : std_logic_vector(15 downto 0);
- signal led0_wbs_strobe : std_logic;
- signal led0_wbs_cycle : std_logic;
- signal led0_wbs_write : std_logic;
- signal led0_wbs_ack : std_logic;
-
- -- button0
- -- int_button
- signal button0_irq : std_logic;
- -- candr
- signal button0_gls_reset : std_logic;
- signal button0_gls_clk : std_logic;
- -- swb16
- signal button0_wbs_add : std_logic;
- signal button0_wbs_readdata : std_logic_vector(15 downto 0);
- signal button0_wbs_strobe : std_logic;
- signal button0_wbs_write : std_logic;
- signal button0_wbs_ack : std_logic;
- signal button0_wbs_cycle : std_logic;
-
- -- imx9328_wb16_wrapper00_mwb16_intercon
+ -- intercon
-- irq_mngr00_swb16
- signal imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_address : std_logic_vector(1 downto 0);
- signal imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_readdata : std_logic_vector(15 downto 0);
- signal imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_writedata : std_logic_vector(15 downto 0);
- signal imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_ack : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_strobe : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_cycle : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_write : std_logic;
+ signal intercon_irq_mngr00_wbs_s1_address : std_logic_vector(1 downto 0);
+ signal intercon_irq_mngr00_wbs_s1_readdata : std_logic_vector(15 downto 0);
+ signal intercon_irq_mngr00_wbs_s1_writedata : std_logic_vector(15 downto 0);
+ signal intercon_irq_mngr00_wbs_s1_ack : std_logic;
+ signal intercon_irq_mngr00_wbs_s1_strobe : std_logic;
+ signal intercon_irq_mngr00_wbs_s1_cycle : std_logic;
+ signal intercon_irq_mngr00_wbs_s1_write : std_logic;
-- irq_mngr00_candr
- signal imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_gls_clk : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_gls_reset : std_logic;
+ signal intercon_irq_mngr00_gls_clk : std_logic;
+ signal intercon_irq_mngr00_gls_reset : std_logic;
-- led0_swb16
- signal imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_add : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_writedata : std_logic_vector(15 downto 0);
- signal imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_readdata : std_logic_vector(15 downto 0);
- signal imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_strobe : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_cycle : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_write : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_ack : std_logic;
+ signal intercon_led0_wbs_add : std_logic;
+ signal intercon_led0_wbs_writedata : std_logic_vector(15 downto 0);
+ signal intercon_led0_wbs_readdata : std_logic_vector(15 downto 0);
+ signal intercon_led0_wbs_strobe : std_logic;
+ signal intercon_led0_wbs_cycle : std_logic;
+ signal intercon_led0_wbs_write : std_logic;
+ signal intercon_led0_wbs_ack : std_logic;
-- led0_candr
- signal imx9328_wb16_wrapper00_mwb16_intercon_led0_gls_reset : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_led0_gls_clk : std_logic;
+ signal intercon_led0_gls_reset : std_logic;
+ signal intercon_led0_gls_clk : std_logic;
-- button0_swb16
- signal imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_add : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_readdata : std_logic_vector(15 downto 0);
- signal imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_strobe : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_write : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_ack : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_cycle : std_logic;
+ signal intercon_button0_wbs_add : std_logic;
+ signal intercon_button0_wbs_readdata : std_logic_vector(15 downto 0);
+ signal intercon_button0_wbs_strobe : std_logic;
+ signal intercon_button0_wbs_write : std_logic;
+ signal intercon_button0_wbs_ack : std_logic;
+ signal intercon_button0_wbs_cycle : std_logic;
-- button0_candr
- signal imx9328_wb16_wrapper00_mwb16_intercon_button0_gls_reset : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_button0_gls_clk : std_logic;
- -- imx9328_wb16_wrapper00_mwb16
- signal imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_address : std_logic_vector(12 downto 0);
- signal imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_readdata : std_logic_vector(15 downto 0);
- signal imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_writedata : std_logic_vector(15 downto 0);
- signal imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_strobe : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_write : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_ack : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_cycle : std_logic;
- -- imx9328_wb16_wrapper00_candr
- signal imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_gls_reset : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_gls_clk : std_logic;
- -- rstgen_syscon00_imx9328_wb16_wrapper00
- signal imx9328_wb16_wrapper00_mwb16_intercon_rstgen_syscon00_gls_clk : std_logic;
- signal imx9328_wb16_wrapper00_mwb16_intercon_rstgen_syscon00_gls_reset : std_logic;
+ signal intercon_button0_gls_reset : std_logic;
+ signal intercon_button0_gls_clk : std_logic;
+ -- wrapper
+ signal intercon_wrapper_wbm_address : std_logic_vector(12 downto 0);
+ signal intercon_wrapper_wbm_readdata : std_logic_vector(15 downto 0);
+ signal intercon_wrapper_wbm_writedata : std_logic_vector(15 downto 0);
+ signal intercon_wrapper_wbm_strobe : std_logic;
+ signal intercon_wrapper_wbm_write : std_logic;
+ signal intercon_wrapper_wbm_ack : std_logic;
+ signal intercon_wrapper_wbm_cycle : std_logic;
+ -- wrapper_candr
+ signal intercon_wrapper_gls_reset : std_logic;
+ signal intercon_wrapper_gls_clk : std_logic;
+ -- rstgen_syscon00_wrapper
+ signal intercon_rstgen_syscon00_gls_clk : std_logic;
+ signal intercon_rstgen_syscon00_gls_reset : std_logic;
- -- void pins
+ -- irq_mngr
+ signal irq_mngr00_irqport : std_logic_vector( 0 downto 0) ;
begin
-------------------------
-- declare instances
-------------------------
- imx9328_wb16_wrapper00 : imx9328_wb16_wrapper
+ wrapper : wishbone_wrapper
port map (
-- eim
- imx_address => imx9328_wb16_wrapper00_imx_address,
- imx_data => imx9328_wb16_wrapper00_imx_data,
- imx_cs_n => imx9328_wb16_wrapper00_imx_cs_n,
- imx_oe_n => imx9328_wb16_wrapper00_imx_oe_n,
- imx_eb3_n => imx9328_wb16_wrapper00_imx_eb3_n,
+ imx_address => imx_address,
+ imx_data => imx_data,
+ imx_cs_n => imx_cs_n,
+ imx_oe_n => imx_oe_n,
+ imx_eb3_n => imx_eb3_n,
-- candr
- gls_reset => imx9328_wb16_wrapper00_gls_reset,
- gls_clk => imx9328_wb16_wrapper00_gls_clk,
+ gls_reset => intercon_wrapper_gls_reset,
+ gls_clk => intercon_wrapper_gls_clk,
-- mwb16
- wbm_address => imx9328_wb16_wrapper00_wbm_address,
- wbm_readdata => imx9328_wb16_wrapper00_wbm_readdata,
- wbm_writedata => imx9328_wb16_wrapper00_wbm_writedata,
- wbm_strobe => imx9328_wb16_wrapper00_wbm_strobe,
- wbm_write => imx9328_wb16_wrapper00_wbm_write,
- wbm_ack => imx9328_wb16_wrapper00_wbm_ack,
- wbm_cycle => imx9328_wb16_wrapper00_wbm_cycle
+ wbm_address => intercon_wrapper_wbm_address,
+ wbm_readdata => intercon_wrapper_wbm_readdata,
+ wbm_writedata=> intercon_wrapper_wbm_writedata,
+ wbm_strobe => intercon_wrapper_wbm_strobe,
+ wbm_write => intercon_wrapper_wbm_write,
+ wbm_ack => intercon_wrapper_wbm_ack,
+ wbm_cycle => intercon_wrapper_wbm_cycle
);
rstgen_syscon00 : rstgen_syscon
port map (
-- candr
- gls_clk => rstgen_syscon00_gls_clk,
- gls_reset => rstgen_syscon00_gls_reset,
+ gls_clk => intercon_rstgen_syscon00_gls_clk,
+ gls_reset => intercon_rstgen_syscon00_gls_reset,
-- clk_ext
- ext_clk => rstgen_syscon00_ext_clk
+ ext_clk => ext_clk
);
irq_mngr00 : irq_mngr
@@ -347,20 +284,20 @@
)
port map (
-- candr
- gls_clk => irq_mngr00_gls_clk,
- gls_reset => irq_mngr00_gls_reset,
+ gls_clk => intercon_irq_mngr00_gls_clk,
+ gls_reset => intercon_irq_mngr00_gls_reset,
-- swb16
- wbs_s1_address => irq_mngr00_wbs_s1_address,
- wbs_s1_readdata => irq_mngr00_wbs_s1_readdata,
- wbs_s1_writedata => irq_mngr00_wbs_s1_writedata,
- wbs_s1_ack => irq_mngr00_wbs_s1_ack,
- wbs_s1_strobe => irq_mngr00_wbs_s1_strobe,
- wbs_s1_cycle => irq_mngr00_wbs_s1_cycle,
- wbs_s1_write => irq_mngr00_wbs_s1_write,
+ wbs_s1_address => intercon_irq_mngr00_wbs_s1_address,
+ wbs_s1_readdata => intercon_irq_mngr00_wbs_s1_readdata,
+ wbs_s1_writedata=> intercon_irq_mngr00_wbs_s1_writedata,
+ wbs_s1_ack => intercon_irq_mngr00_wbs_s1_ack,
+ wbs_s1_strobe => intercon_irq_mngr00_wbs_s1_strobe,
+ wbs_s1_cycle => intercon_irq_mngr00_wbs_s1_cycle,
+ wbs_s1_write => intercon_irq_mngr00_wbs_s1_write,
-- irq
- irqport => irq_mngr00_irqport,
+ irqport => irq_mngr00_irqport,
-- ext_irq
- gls_irq => irq_mngr00_gls_irq
+ gls_irq => gls_irq
);
led0 : led
@@ -370,18 +307,18 @@
)
port map (
-- int_led
- led => led0_led,
+ led_o => led_o,
-- candr
- gls_reset => led0_gls_reset,
- gls_clk => led0_gls_clk,
+ gls_reset => intercon_led0_gls_reset,
+ gls_clk => intercon_led0_gls_clk,
-- swb16
- wbs_add => led0_wbs_add,
- wbs_writedata => led0_wbs_writedata,
- wbs_readdata => led0_wbs_readdata,
- wbs_strobe => led0_wbs_strobe,
- wbs_cycle => led0_wbs_cycle,
- wbs_write => led0_wbs_write,
- wbs_ack => led0_wbs_ack
+ wbs_add => intercon_led0_wbs_add,
+ wbs_writedata=> intercon_led0_wbs_writedata,
+ wbs_readdata => intercon_led0_wbs_readdata,
+ wbs_strobe => intercon_led0_wbs_strobe,
+ wbs_cycle => intercon_led0_wbs_cycle,
+ wbs_write => intercon_led0_wbs_write,
+ wbs_ack => intercon_led0_wbs_ack
);
button0 : button
@@ -390,146 +327,69 @@
)
port map (
-- int_button
- button => button0_button,
- irq => button0_irq,
+ button_i => button_i,
+ irq => irq_mngr00_irqport(0),
-- candr
- gls_reset => button0_gls_reset,
- gls_clk => button0_gls_clk,
+ gls_reset => intercon_button0_gls_reset,
+ gls_clk => intercon_button0_gls_clk,
-- swb16
- wbs_add => button0_wbs_add,
- wbs_readdata => button0_wbs_readdata,
- wbs_strobe => button0_wbs_strobe,
- wbs_write => button0_wbs_write,
- wbs_ack => button0_wbs_ack,
- wbs_cycle => button0_wbs_cycle
+ wbs_add => intercon_button0_wbs_add,
+ wbs_readdata => intercon_button0_wbs_readdata,
+ wbs_strobe => intercon_button0_wbs_strobe,
+ wbs_write => intercon_button0_wbs_write,
+ wbs_ack => intercon_button0_wbs_ack,
+ wbs_cycle => intercon_button0_wbs_cycle
);
- imx9328_wb16_wrapper00_mwb16_intercon : imx9328_wb16_wrapper00_mwb16
+ intercon_intercon : intercon
port map (
-- irq_mngr00_swb16
- irq_mngr00_wbs_s1_address => imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_address,
- irq_mngr00_wbs_s1_readdata => imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_readdata,
- irq_mngr00_wbs_s1_writedata => imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_writedata,
- irq_mngr00_wbs_s1_ack => imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_ack,
- irq_mngr00_wbs_s1_strobe => imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_strobe,
- irq_mngr00_wbs_s1_cycle => imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_cycle,
- irq_mngr00_wbs_s1_write => imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_write,
+ irq_mngr00_wbs_s1_address => intercon_irq_mngr00_wbs_s1_address,
+ irq_mngr00_wbs_s1_readdata => intercon_irq_mngr00_wbs_s1_readdata,
+ irq_mngr00_wbs_s1_writedata => intercon_irq_mngr00_wbs_s1_writedata,
+ irq_mngr00_wbs_s1_ack => intercon_irq_mngr00_wbs_s1_ack,
+ irq_mngr00_wbs_s1_strobe => intercon_irq_mngr00_wbs_s1_strobe,
+ irq_mngr00_wbs_s1_cycle => intercon_irq_mngr00_wbs_s1_cycle,
+ irq_mngr00_wbs_s1_write => intercon_irq_mngr00_wbs_s1_write,
-- irq_mngr00_candr
- irq_mngr00_gls_clk => imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_gls_clk,
- irq_mngr00_gls_reset => imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_gls_reset,
+ irq_mngr00_gls_clk => intercon_irq_mngr00_gls_clk,
+ irq_mngr00_gls_reset => intercon_irq_mngr00_gls_reset,
-- led0_swb16
- led0_wbs_add => imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_add,
- led0_wbs_writedata => imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_writedata,
- led0_wbs_readdata => imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_readdata,
- led0_wbs_strobe => imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_strobe,
- led0_wbs_cycle => imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_cycle,
- led0_wbs_write => imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_write,
- led0_wbs_ack => imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_ack,
+ led0_wbs_add => intercon_led0_wbs_add,
+ led0_wbs_writedata => intercon_led0_wbs_writedata,
+ led0_wbs_readdata => intercon_led0_wbs_readdata,
+ led0_wbs_strobe => intercon_led0_wbs_strobe,
+ led0_wbs_cycle => intercon_led0_wbs_cycle,
+ led0_wbs_write => intercon_led0_wbs_write,
+ led0_wbs_ack => intercon_led0_wbs_ack,
-- led0_candr
- led0_gls_reset => imx9328_wb16_wrapper00_mwb16_intercon_led0_gls_reset,
- led0_gls_clk => imx9328_wb16_wrapper00_mwb16_intercon_led0_gls_clk,
+ led0_gls_reset => intercon_led0_gls_reset,
+ led0_gls_clk => intercon_led0_gls_clk,
-- button0_swb16
- button0_wbs_add => imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_add,
- button0_wbs_readdata => imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_readdata,
- button0_wbs_strobe => imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_strobe,
- button0_wbs_write => imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_write,
- button0_wbs_ack => imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_ack,
- button0_wbs_cycle => imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_cycle,
+ button0_wbs_add => intercon_button0_wbs_add,
+ button0_wbs_readdata => intercon_button0_wbs_readdata,
+ button0_wbs_strobe => intercon_button0_wbs_strobe,
+ button0_wbs_write => intercon_button0_wbs_write,
+ button0_wbs_ack => intercon_button0_wbs_ack,
+ button0_wbs_cycle => intercon_button0_wbs_cycle,
-- button0_candr
- button0_gls_reset => imx9328_wb16_wrapper00_mwb16_intercon_button0_gls_reset,
- button0_gls_clk => imx9328_wb16_wrapper00_mwb16_intercon_button0_gls_clk,
- -- imx9328_wb16_wrapper00_mwb16
- imx9328_wb16_wrapper00_wbm_address => imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_address,
- imx9328_wb16_wrapper00_wbm_readdata => imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_readdata,
- imx9328_wb16_wrapper00_wbm_writedata => imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_writedata,
- imx9328_wb16_wrapper00_wbm_strobe => imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_strobe,
- imx9328_wb16_wrapper00_wbm_write => imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_write,
- imx9328_wb16_wrapper00_wbm_ack => imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_ack,
- imx9328_wb16_wrapper00_wbm_cycle => imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_cycle,
- -- imx9328_wb16_wrapper00_candr
- imx9328_wb16_wrapper00_gls_reset => imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_gls_reset,
- imx9328_wb16_wrapper00_gls_clk => imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_gls_clk,
- -- rstgen_syscon00_imx9328_wb16_wrapper00
- rstgen_syscon00_gls_clk => imx9328_wb16_wrapper00_mwb16_intercon_rstgen_syscon00_gls_clk,
- rstgen_syscon00_gls_reset => imx9328_wb16_wrapper00_mwb16_intercon_rstgen_syscon00_gls_reset
+ button0_gls_reset => intercon_button0_gls_reset,
+ button0_gls_clk => intercon_button0_gls_clk,
+ -- intercon
+ wrapper_wbm_address => intercon_wrapper_wbm_address,
+ wrapper_wbm_readdata => intercon_wrapper_wbm_readdata,
+ wrapper_wbm_writedata => intercon_wrapper_wbm_writedata,
+ wrapper_wbm_strobe => intercon_wrapper_wbm_strobe,
+ wrapper_wbm_write => intercon_wrapper_wbm_write,
+ wrapper_wbm_ack => intercon_wrapper_wbm_ack,
+ wrapper_wbm_cycle => intercon_wrapper_wbm_cycle,
+ -- wrapper_candr
+ wrapper_gls_reset => intercon_wrapper_gls_reset,
+ wrapper_gls_clk => intercon_wrapper_gls_clk,
+ -- rstgen_syscon00_wrapper
+ rstgen_syscon00_gls_clk => intercon_rstgen_syscon00_gls_clk,
+ rstgen_syscon00_gls_reset => intercon_rstgen_syscon00_gls_reset
);
- ---------------------------
- -- instances connections --
- ---------------------------
-
- -- connect imx9328_wb16_wrapper00
- -- eim
- -- candr
- imx9328_wb16_wrapper00_gls_reset <= imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_gls_reset;
- imx9328_wb16_wrapper00_gls_clk <= imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_gls_clk;
- -- mwb16
- imx9328_wb16_wrapper00_wbm_readdata <= imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_readdata;
- imx9328_wb16_wrapper00_wbm_ack <= imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_ack;
-
- -- connect rstgen_syscon00
- -- candr
- -- clk_ext
-
- -- connect irq_mngr00
- -- candr
- irq_mngr00_gls_clk <= imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_gls_clk;
- irq_mngr00_gls_reset <= imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_gls_reset;
- -- swb16
- irq_mngr00_wbs_s1_address <= imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_address;
- irq_mngr00_wbs_s1_writedata <= imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_writedata;
- irq_mngr00_wbs_s1_strobe <= imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_strobe;
- irq_mngr00_wbs_s1_cycle <= imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_cycle;
- irq_mngr00_wbs_s1_write <= imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_write;
- -- irq
- irq_mngr00_irqport(0) <= button0_irq;
- -- ext_irq
-
- -- connect led0
- -- int_led
- -- candr
- led0_gls_reset <= imx9328_wb16_wrapper00_mwb16_intercon_led0_gls_reset;
- led0_gls_clk <= imx9328_wb16_wrapper00_mwb16_intercon_led0_gls_clk;
- -- swb16
- led0_wbs_add <= imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_add;
- led0_wbs_writedata <= imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_writedata;
- led0_wbs_strobe <= imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_strobe;
- led0_wbs_cycle <= imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_cycle;
- led0_wbs_write <= imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_write;
-
- -- connect button0
- -- int_button
- -- candr
- button0_gls_reset <= imx9328_wb16_wrapper00_mwb16_intercon_button0_gls_reset;
- button0_gls_clk <= imx9328_wb16_wrapper00_mwb16_intercon_button0_gls_clk;
- -- swb16
- button0_wbs_add <= imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_add;
- button0_wbs_strobe <= imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_strobe;
- button0_wbs_write <= imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_write;
- button0_wbs_cycle <= imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_cycle;
-
- -- connect imx9328_wb16_wrapper00_mwb16_intercon
- -- irq_mngr00_swb16
- imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_readdata <= irq_mngr00_wbs_s1_readdata;
- imx9328_wb16_wrapper00_mwb16_intercon_irq_mngr00_wbs_s1_ack <= irq_mngr00_wbs_s1_ack;
- -- irq_mngr00_candr
- -- led0_swb16
- imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_readdata <= led0_wbs_readdata;
- imx9328_wb16_wrapper00_mwb16_intercon_led0_wbs_ack <= led0_wbs_ack;
- -- led0_candr
- -- button0_swb16
- imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_readdata <= button0_wbs_readdata;
- imx9328_wb16_wrapper00_mwb16_intercon_button0_wbs_ack <= button0_wbs_ack;
- -- button0_candr
- -- imx9328_wb16_wrapper00_mwb16
- imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_address <= imx9328_wb16_wrapper00_wbm_address;
- imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_writedata <= imx9328_wb16_wrapper00_wbm_writedata;
- imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_strobe <= imx9328_wb16_wrapper00_wbm_strobe;
- imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_write <= imx9328_wb16_wrapper00_wbm_write;
- imx9328_wb16_wrapper00_mwb16_intercon_imx9328_wb16_wrapper00_wbm_cycle <= imx9328_wb16_wrapper00_wbm_cycle;
- -- imx9328_wb16_wrapper00_candr
- -- rstgen_syscon00_imx9328_wb16_wrapper00
- imx9328_wb16_wrapper00_mwb16_intercon_rstgen_syscon00_gls_clk <= rstgen_syscon00_gls_clk;
- imx9328_wb16_wrapper00_mwb16_intercon_rstgen_syscon00_gls_reset <= rstgen_syscon00_gls_reset;
-
end architecture top_wishbone_example_1;
+
Deleted: trunk/firmware/wishbone_example/src/wishbone_example.ucf
===================================================================
--- trunk/firmware/wishbone_example/src/wishbone_example.ucf 2009-03-12 16:03:28 UTC (rev 1154)
+++ trunk/firmware/wishbone_example/src/wishbone_example.ucf 2009-03-12 16:25:53 UTC (rev 1155)
@@ -1,76 +0,0 @@
-# Constraint file, automaticaly generated by pod
-NET "imx9328_wb16_wrapper00_imx_data<0>" LOC="P1" | IOSTANDARD=LVCMOS33;# D0
-NET "imx9328_wb16_wrapper00_imx_data<1>" LOC="P2" | IOSTANDARD=LVCMOS33;# D1
-NET "imx9328_wb16_wrapper00_imx_data<2>" LOC="P4" | IOSTANDARD=LVCMOS33;# D2
-NET "imx9328_wb16_wrapper00_imx_data<3>" LOC="P5" | IOSTANDARD=LVCMOS33;# D3
-NET "imx9328_wb16_wrapper00_imx_data<4>" LOC="P6" | IOSTANDARD=LVCMOS33;# D4
-NET "imx9328_wb16_wrapper00_imx_data<5>" LOC="P7" | IOSTANDARD=LVCMOS33;# D5
-NET "imx9328_wb16_wrapper00_imx_data<6>" LOC="P8" | IOSTANDARD=LVCMOS33;# D6
-NET "imx9328_wb16_wrapper00_imx_data<7>" LOC="P10" | IOSTANDARD=LVCMOS33;# D7
-NET "imx9328_wb16_wrapper00_imx_data<8>" LOC="P11" | IOSTANDARD=LVCMOS33;# D8
-NET "imx9328_wb16_wrapper00_imx_data<9>" LOC="P12" | IOSTANDARD=LVCMOS33;# D9
-NET "imx9328_wb16_wrapper00_imx_data<10>" LOC="P13" | IOSTANDARD=LVCMOS33;# D10
-NET "imx9328_wb16_wrapper00_imx_data<11>" LOC="P14" | IOSTANDARD=LVCMOS33;# D11
-NET "imx9328_wb16_wrapper00_imx_data<12>" LOC="P15" | IOSTANDARD=LVCMOS33;# D12
-NET "imx9328_wb16_wrapper00_imx_data<13>" LOC="P17" | IOSTANDARD=LVCMOS33;# D13
-NET "imx9328_wb16_wrapper00_imx_data<14>" LOC="P18" | IOSTANDARD=LVCMOS33;# D14
-NET "imx9328_wb16_wrapper00_imx_data<15>" LOC="P20" | IOSTANDARD=LVCMOS33;# D15
-NET "imx9328_wb16_wrapper00_imx_address<0>" LOC="P23" | IOSTANDARD=LVCMOS33;# A1
-NET "imx9328_wb16_wrapper00_imx_address<1>" LOC="P24" | IOSTANDARD=LVCMOS33;# A2
-NET "imx9328_wb16_wrapper00_imx_address<2>" LOC="P25" | IOSTANDARD=LVCMOS33;# A3
-NET "imx9328_wb16_wrapper00_imx_address<3>" LOC="P26" | IOSTANDARD=LVCMOS33;# A4
-NET "imx9328_wb16_wrapper00_imx_address<4>" LOC="P27" | IOSTANDARD=LVCMOS33;# A5
-NET "imx9328_wb16_wrapper00_imx_address<5>" LOC="P28" | IOSTANDARD=LVCMOS33;# A6
-NET "imx9328_wb16_wrapper00_imx_address<6>" LOC="P30" | IOSTANDARD=LVCMOS33;# A7
-NET "imx9328_wb16_wrapper00_imx_address<7>" LOC="P31" | IOSTANDARD=LVCMOS33;# A8
-NET "imx9328_wb16_wrapper00_imx_address<8>" LOC="P32" | IOSTANDARD=LVCMOS33;# A9
-NET "imx9328_wb16_wrapper00_imx_address<9>" LOC="P33" | IOSTANDARD=LVCMOS33;# A10
-NET "imx9328_wb16_wrapper00_imx_address<10>" LOC="P35" | IOSTANDARD=LVCMOS33;# A11
-NET "imx9328_wb16_wrapper00_imx_address<11>" LOC="P36" | IOSTANDARD=LVCMOS33;# A12
-NET "rstgen_syscon00_ext_clk" LOC="P55" | IOSTANDARD=LVCMOS33;# CLK0
-NET "rstgen_syscon00_ext_clk" TNM_NET = "rstgen_syscon00_ext_clk";
-TIMESPEC "TS_rstgen_syscon00_ext_clk" = PERIOD "rstgen_syscon00_ext_clk" 10.4167 ns HIGH 50 %;
-NET "imx9328_wb16_wrapper00_imx_cs_n" LOC="P59" | IOSTANDARD=LVCMOS33;# CTRL1
-NET "imx9328_wb16_wrapper00_imx_eb3_n" LOC="P60" | IOSTANDARD=LVCMOS33;# CTRL9
-NET "imx9328_wb16_wrapper00_imx_oe_n" LOC="P63" | IOSTANDARD=LVCMOS33;# CTRL10
-NET "irq_mngr00_gls_irq" LOC="P68" | IOSTANDARD=LVCMOS33;# TIM1
-NET "led0_led" LOC="P116" | IOSTANDARD=LVCMOS33;# IO_1
-NET "button0_button" LOC="P141" | IOSTANDARD=LVCMOS33;# IO_L01N_0
-NET "imx9328_wb16_wrapper00_imx_data<0>" LOC="P1" | IOSTANDARD=LVCMOS33;# D0
-NET "imx9328_wb16_wrapper00_imx_data<1>" LOC="P2" | IOSTANDARD=LVCMOS33;# D1
-NET "imx9328_wb16_wrapper00_imx_data<2>" LOC="P4" | IOSTANDARD=LVCMOS33;# D2
-NET "imx9328_wb16_wrapper00_imx_data<3>" LOC="P5" | IOSTANDARD=LVCMOS33;# D3
-NET "imx9328_wb16_wrapper00_imx_data<4>" LOC="P6" | IOSTANDARD=LVCMOS33;# D4
-NET "imx9328_wb16_wrapper00_imx_data<5>" LOC="P7" | IOSTANDARD=LVCMOS33;# D5
-NET "imx9328_wb16_wrapper00_imx_data<6>" LOC="P8" | IOSTANDARD=LVCMOS33;# D6
-NET "imx9328_wb16_wrapper00_imx_data<7>" LOC="P10" | IOSTANDARD=LVCMOS33;# D7
-NET "imx9328_wb16_wrapper00_imx_data<8>" LOC="P11" | IOSTANDARD=LVCMOS33;# D8
-NET "imx9328_wb16_wrapper00_imx_data<9>" LOC="P12" | IOSTANDARD=LVCMOS33;# D9
-NET "imx9328_wb16_wrapper00_imx_data<10>" LOC="P13" | IOSTANDARD=LVCMOS33;# D10
-NET "imx9328_wb16_wrapper00_imx_data<11>" LOC="P14" | IOSTANDARD=LVCMOS33;# D11
-NET "imx9328_wb16_wrapper00_imx_data<12>" LOC="P15" | IOSTANDARD=LVCMOS33;# D12
-NET "imx9328_wb16_wrapper00_imx_data<13>" LOC="P17" | IOSTANDARD=LVCMOS33;# D13
-NET "imx9328_wb16_wrapper00_imx_data<14>" LOC="P18" | IOSTANDARD=LVCMOS33;# D14
-NET "imx9328_wb16_wrapper00_imx_data<15>" LOC="P20" | IOSTANDARD=LVCMOS33;# D15
-NET "imx9328_wb16_wrapper00_imx_address<0>" LOC="P23" | IOSTANDARD=LVCMOS33;# A1
-NET "imx9328_wb16_wrapper00_imx_address<1>" LOC="P24" | IOSTANDARD=LVCMOS33;# A2
-NET "imx9328_wb16_wrapper00_imx_address<2>" LOC="P25" | IOSTANDARD=LVCMOS33;# A3
-NET "imx9328_wb16_wrapper00_imx_address<3>" LOC="P26" | IOSTANDARD=LVCMOS33;# A4
-NET "imx9328_wb16_wrapper00_imx_address<4>" LOC="P27" | IOSTANDARD=LVCMOS33;# A5
-NET "imx9328_wb16_wrapper00_imx_address<5>" LOC="P28" | IOSTANDARD=LVCMOS33;# A6
-NET "imx9328_wb16_wrapper00_imx_address<6>" LOC="P30" | IOSTANDARD=LVCMOS33;# A7
-NET "imx9328_wb16_wrapper00_imx_address<7>" LOC="P31" | IOSTANDARD=LVCMOS33;# A8
-NET "imx9328_wb16_wrapper00_imx_address<8>" LOC="P32" | IOSTANDARD=LVCMOS33;# A9
-NET "imx9328_wb16_wrapper00_imx_address<9>" LOC="P33" | IOSTANDARD=LVCMOS33;# A10
-NET "imx9328_wb16_wrapper00_imx_address<10>" LOC="P35" | IOSTANDARD=LVCMOS33;# A11
-NET "imx9328_wb16_wrapper00_imx_address<11>" LOC="P36" | IOSTANDARD=LVCMOS33;# A12
-NET "rstgen_syscon00_ext_clk" LOC="P55" | IOSTANDARD=LVCMOS33;# CLK0
-NET "rstgen_syscon00_ext_clk" TNM_NET = "rstgen_syscon00_ext_clk";
-TIMESPEC "TS_rstgen_syscon00_ext_clk" = PERIOD "rstgen_syscon00_ext_clk" 10.4167 ns HIGH 50 %;
-NET "imx9328_wb16_wrapper00_imx_cs_n" LOC="P59" | IOSTANDARD=LVCMOS...
[truncated message content] |
|
From: <th...@us...> - 2009-03-12 16:03:47
|
Revision: 1154
http://armadeus.svn.sourceforge.net/armadeus/?rev=1154&view=rev
Author: thom25
Date: 2009-03-12 16:03:28 +0000 (Thu, 12 Mar 2009)
Log Message:
-----------
[LINUX] fpgaloader: call post init function once download done
Modified Paths:
--------------
trunk/target/linux/modules/fpga/dev_tools/loader/xilinx-fpga-loader.c
Modified: trunk/target/linux/modules/fpga/dev_tools/loader/xilinx-fpga-loader.c
===================================================================
--- trunk/target/linux/modules/fpga/dev_tools/loader/xilinx-fpga-loader.c 2009-03-12 12:58:24 UTC (rev 1153)
+++ trunk/target/linux/modules/fpga/dev_tools/loader/xilinx-fpga-loader.c 2009-03-12 16:03:28 UTC (rev 1154)
@@ -298,6 +298,7 @@
(*fn->cs) (0); /* Deassert the chip select */
(*fn->wr) (0); /* Deassert the write pin */
+ (*fn->post) (); /* post init */
}
return 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Fa...@us...> - 2009-03-12 12:58:34
|
Revision: 1153
http://armadeus.svn.sourceforge.net/armadeus/?rev=1153&view=rev
Author: FabM
Date: 2009-03-12 12:58:24 +0000 (Thu, 12 Mar 2009)
Log Message:
-----------
[LINUX] Update config file for wishbone_example drivers
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.27.13.config
Modified: trunk/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.27.13.config
===================================================================
--- trunk/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.27.13.config 2009-03-12 10:49:33 UTC (rev 1152)
+++ trunk/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.27.13.config 2009-03-12 12:58:24 UTC (rev 1153)
@@ -1119,13 +1119,13 @@
#
# FPGA Drivers
#
-CONFIG_ARMADEUS_FPGA_DRIVERS=y
-CONFIG_ARMADEUS_FPGA_TEST=y
-CONFIG_ARMADEUS_FPGA_LOADER_DRIVER=m
-CONFIG_ARMADEUS_FPGAACCESS_DRIVER=m
-CONFIG_ARMADEUS_FPGA_OTHERS_DRIVERS=y
+CONFIG_ARMADEUS_FPGA_DRIVERS=n
# CONFIG_ARMADEUS_BUTTON_DRIVER is not set
# CONFIG_ARMADEUS_LED_DRIVER is not set
+CONFIG_ARMADEUS_WISHBONE_EXAMPLE_DRIVERS=n
+CONFIG_ARMADEUS_WISHBONE_EXAMPLE_BUTTON_DRIVER=n
+CONFIG_ARMADEUS_WISHBONE_EXAMPLE_LED_DRIVER=n
+CONFIG_ARMADEUS_WISHBONE_EXAMPLE_IRQ_MNGR_DRIVER=n
# CONFIG_ARMADEUS_I2C_OCORE_IRQMNG is not set
CONFIG_ARMADEUS_PS2KBD_DRIVER=m
# CONFIG_POD_DRIVERS is not set
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <th...@us...> - 2009-03-12 10:50:01
|
Revision: 1152
http://armadeus.svn.sourceforge.net/armadeus/?rev=1152&view=rev
Author: thom25
Date: 2009-03-12 10:49:33 +0000 (Thu, 12 Mar 2009)
Log Message:
-----------
[TEST] add APF27Dev ADC/DAC auto test
Added Paths:
-----------
trunk/target/test/apf27devfull_adcdac_test.sh
Added: trunk/target/test/apf27devfull_adcdac_test.sh
===================================================================
--- trunk/target/test/apf27devfull_adcdac_test.sh (rev 0)
+++ trunk/target/test/apf27devfull_adcdac_test.sh 2009-03-12 10:49:33 UTC (rev 1152)
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+#
+# Script to test Armadeus APF27Dev ADC/DAC
+#
+# Copyright (C) 2008 The Armadeus Project
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+
+show_test_banner()
+{
+ echo -e "\033[1m******** Testing $1 ********\033[0m"
+}
+
+test_ADCDAC()
+{
+ show_test_banner "ADC DAC"
+ modprobe max1027
+
+ setDAC A 614
+ setDAC B 820
+
+ if [ "$?" == 0 ]; then
+ let set=0x62; echo $set > /sys/bus/spi/devices/spi0.0/setup
+ sleep 1
+ let conv=0xb0; echo $conv > /sys/bus/spi/devices/spi0.0/conversion
+ sleep 1
+ result=`cat /sys/bus/spi/devices/spi0.0/in0_input`
+ if [ "$result" -gt 1080 ] && [ "$result" -lt 1320 ]; then
+ echo "AIN0: ok"
+ else
+ echo "AIN0: $result"
+ fi
+ result=`cat /sys/bus/spi/devices/spi0.0/in1_input`
+ if [ "$result" -gt 650 ] && [ "$result" -lt 790 ]; then
+ echo "AIN1: ok"
+ else
+ echo "AIN1: $result"
+ fi
+ result=`cat /sys/bus/spi/devices/spi0.0/in2_input`
+ if [ "$result" -gt 1300 ] && [ "$result" -lt 1580 ]; then
+ echo "AIN2: ok"
+ else
+ echo "AIN2: $result"
+ fi
+ result=`cat /sys/bus/spi/devices/spi0.0/in3_input`
+ if [ "$result" -gt 860 ] && [ "$result" -lt 1060 ]; then
+ echo "AIN3: ok"
+ else
+ echo "AIN3: $result"
+ fi
+ result=`cat /sys/bus/spi/devices/spi0.0/in4_input`
+ if [ "$result" -gt 1080 ] && [ "$result" -lt 1320 ]; then
+ echo "AIN4: ok"
+ else
+ echo "AIN4: $result"
+ fi
+ result=`cat /sys/bus/spi/devices/spi0.0/in5_input`
+ if [ "$result" -gt 1730 ] && [ "$result" -lt 2110 ]; then
+ echo "AIN5: ok"
+ else
+ echo "AIN5: $result"
+ fi
+ result=`cat /sys/bus/spi/devices/spi0.0/in6_input`
+ if [ "$result" -gt 1080 ] && [ "$result" -lt 1320 ]; then
+ echo "AIN6: ok"
+ else
+ echo "AIN6: $result"
+ fi
+ fi
+}
+
+test_ADCDAC
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <th...@us...> - 2009-03-12 10:01:05
|
Revision: 1151
http://armadeus.svn.sourceforge.net/armadeus/?rev=1151&view=rev
Author: thom25
Date: 2009-03-12 10:00:55 +0000 (Thu, 12 Mar 2009)
Log Message:
-----------
[LINUX] MCP2515 driver: fix startup delay to a long enough value
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/088-can-mcp2515.patch
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/088-can-mcp2515.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/088-can-mcp2515.patch 2009-03-12 09:19:38 UTC (rev 1150)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/088-can-mcp2515.patch 2009-03-12 10:00:55 UTC (rev 1151)
@@ -639,7 +639,7 @@
+ /* Wait whilst the device wakes up */
+ int i = 200 * (128 * USEC_PER_SEC / pdata->oscillator_frequency);
+ if( i> 1000 ) /*large delay, use mdelay*/
-+ mdelay( (i+500)/1000);
++ mdelay(10);
+ else
+ udelay(i);
+ priv->wake = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <th...@us...> - 2009-03-12 09:20:40
|
Revision: 1150
http://armadeus.svn.sourceforge.net/armadeus/?rev=1150&view=rev
Author: thom25
Date: 2009-03-12 09:19:38 +0000 (Thu, 12 Mar 2009)
Log Message:
-----------
[LINUX] fix TFT init bug (ticket 38)
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/281-apf27-armadeus-add_apf27.c.patch
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/281-apf27-armadeus-add_apf27.c.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/281-apf27-armadeus-add_apf27.c.patch 2009-03-11 17:39:25 UTC (rev 1149)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/281-apf27-armadeus-add_apf27.c.patch 2009-03-12 09:19:38 UTC (rev 1150)
@@ -3,7 +3,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.13.original/arch/arm/mach-mx2/apf27.c
+++ linux-2.6.27.13.mod/arch/arm/mach-mx2/apf27.c
-@@ -0,0 +1,1334 @@
+@@ -0,0 +1,1329 @@
+ /*
+ * apf27.c
+ *
@@ -1098,28 +1098,26 @@
+static int gpio_pwr_ctl_active(void)
+{
+ int err;
-+
+
+#ifdef CONFIG_FB_MXC
+ int i;
+ /* force LCD data/control lines to 0 before powering the LCD
+ otherwise start up conditions may not be respected */
-+ for( i=5; i <= 23; i++ ){
-+ mxc_gpio_mode( GPIO_PORTA | i | GPIO_OUT| GPIO_GPIO );
-+ gpio_set_value(GPIO_PORTA | i, 0);
++ for( i=5; i <= 31; i++ ){
++ if( i!=30 ){
++ gpio_set_value(GPIO_PORTA | i, 0);
++ mxc_gpio_mode( GPIO_PORTA | i | GPIO_OUT| GPIO_GPIO );
++ }
+ }
+ /* wait a few milli */
-+ mdelay(5);
++ mdelay(100);
+#endif
+
-+
+ err = mxc_gpio_setup_multiple(apf27dev_pwr_ctl_pins,
+ ARRAY_SIZE(apf27dev_pwr_ctl_pins), "pwr-ctl");
+ if (err < 0)
+ pr_err("Failed to register power control pins !\n");
+
-+
-+
+ apf27dev_power_up();
+#ifdef CONFIG_USE_LED_FOR_PM
+ gpio_set_value(GPIO_PORTF | 14, 0);
@@ -1303,9 +1301,6 @@
+ spi_register_board_info(spi_board_info,
+ ARRAY_SIZE(spi_board_info));
+#endif
-+#ifdef CONFIG_MACH_PCM970_BASEBOARD
-+ pcm970_baseboard_init();
-+#endif
+
+#ifdef CONFIG_FB_MXC
+ mxc_register_device(&mxc_fb_device, &apf27_fb_data);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <th...@us...> - 2009-03-11 17:39:39
|
Revision: 1149
http://armadeus.svn.sourceforge.net/armadeus/?rev=1149&view=rev
Author: thom25
Date: 2009-03-11 17:39:25 +0000 (Wed, 11 Mar 2009)
Log Message:
-----------
[U-BOOT] add FPGA support
Modified Paths:
--------------
trunk/buildroot/target/u-boot/u-boot-1.3.4-310-apf27.patch
Modified: trunk/buildroot/target/u-boot/u-boot-1.3.4-310-apf27.patch
===================================================================
--- trunk/buildroot/target/u-boot/u-boot-1.3.4-310-apf27.patch 2009-03-11 17:30:11 UTC (rev 1148)
+++ trunk/buildroot/target/u-boot/u-boot-1.3.4-310-apf27.patch 2009-03-11 17:39:25 UTC (rev 1149)
@@ -500,7 +500,7 @@
+extern int fpga_busy_fn (int cookie);
--- ref/u-boot-1.3.4/board/armadeus/apf27/lowlevel_init.S 1970-01-01 01:00:00.000000000 +0100
+++ u-boot-1.3.4/board/armadeus/apf27/lowlevel_init.S 2008-12-29 16:27:49.000000000 +0100
-@@ -0,0 +1,331 @@
+@@ -0,0 +1,343 @@
+/*
+ * For clock initialization, see chapter 3 of the "MCIMX27 Multimedia
+ * Applications Processor Reference Manual, Rev. 0.2".
@@ -676,6 +676,7 @@
+ /* Configure PCCR0 and PCCR1 */
+ writel(PCCR0, CFG_PCCR0_VAL)
+ writel(PCCR1, CFG_PCCR1_VAL)
++
+
+.endm /* init_clock */
+
@@ -818,6 +819,17 @@
+
+ port_init
+
++ /* Configure FPGA CLKO */
++ writel(CCSR, CFG_CCSR_VAL)
++
++ /* Configure strentgh for FPGA */
++ writel(DSCR10, CFG_DSCR10_VAL)
++ writel(DSCR3, CFG_DSCR3_VAL)
++ writel(DSCR7, CFG_DSCR7_VAL)
++ writel(DSCR2, CFG_DSCR2_VAL)
++
++
++
+ /* skip clock and sdram initialization if we run from ram */
+ cmp pc, #0xa0000000
+ bls 1f
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <th...@us...> - 2009-03-11 17:30:27
|
Revision: 1148
http://armadeus.svn.sourceforge.net/armadeus/?rev=1148&view=rev
Author: thom25
Date: 2009-03-11 17:30:11 +0000 (Wed, 11 Mar 2009)
Log Message:
-----------
[U-BOOT] add FPGA support
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/apf27/apf27.h
Modified: trunk/buildroot/target/device/armadeus/apf27/apf27.h
===================================================================
--- trunk/buildroot/target/device/armadeus/apf27/apf27.h 2009-03-11 16:11:05 UTC (rev 1147)
+++ trunk/buildroot/target/device/armadeus/apf27/apf27.h 2009-03-11 17:30:11 UTC (rev 1148)
@@ -666,6 +666,19 @@
#define CFG_EIM_VAL 0x00002000
+/* FPGA specific settings */
+/* CLKO */
+#define CFG_CCSR_VAL 0x00000307
+/* drive strength CLKO set to 2*/
+#define CFG_DSCR10_VAL 0x00020000
+/* drive strength A1..A12 set to 2*/
+#define CFG_DSCR3_VAL 0x02AAAAA8
+/* drive strength ctrl*/
+#define CFG_DSCR7_VAL 0x008A08A0
+/* drive strength data*/
+#define CFG_DSCR2_VAL 0xAAAAAAAA
+
+
/*
* Default configuration for GPIOs and peripherals
*/
@@ -810,7 +823,7 @@
/* SSIx CLKO NFC H264 MSHC */
#define CFG_PCDR0_VAL\
- (0x02000000 \
+ (0x02C00000 \
|((((CONFIG_SYS_CLK_FREQ/CONFIG_MSHC_FREQ)-1)&0x3F)<<0) \
|((((CONFIG_HCLK_FREQ/CONFIG_NFC_FREQ)-1)&0x0F)<<6) \
|(((((CONFIG_SYS_CLK_FREQ/CONFIG_H264_FREQ)-2)*2)&0x3F)<<10)\
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-03-11 16:11:11
|
Revision: 1147
http://armadeus.svn.sourceforge.net/armadeus/?rev=1147&view=rev
Author: artemys
Date: 2009-03-11 16:11:05 +0000 (Wed, 11 Mar 2009)
Log Message:
-----------
[BUILDROOT] Add Xenomai option (deactivated) in default buildroot configurations (for apf9328 & apf27)
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/apf27/apf27_defconfig
trunk/buildroot/target/device/armadeus/apf9328/apf9328_defconfig
Modified: trunk/buildroot/target/device/armadeus/apf27/apf27_defconfig
===================================================================
--- trunk/buildroot/target/device/armadeus/apf27/apf27_defconfig 2009-03-11 14:53:27 UTC (rev 1146)
+++ trunk/buildroot/target/device/armadeus/apf27/apf27_defconfig 2009-03-11 16:11:05 UTC (rev 1147)
@@ -1,6 +1,6 @@
#
# Automatically generated make config: don't edit
-# Mon Feb 2 20:39:06 2009
+# Wed Mar 11 17:06:45 2009
#
BR2_HAVE_DOT_CONFIG=y
BR2_VERSION="0.10.0-svn"
@@ -362,6 +362,7 @@
# BR2_PACKAGE_STARTUP_NOTIFICATION is not set
BR2_PACKAGE_STRACE=y
# BR2_PACKAGE_SUDO is not set
+# BR2_PACKAGE_XENOMAI is not set
# BR2_DATABASE_SUPPORT is not set
BR2_NETWORK_SUPPORT=y
Modified: trunk/buildroot/target/device/armadeus/apf9328/apf9328_defconfig
===================================================================
--- trunk/buildroot/target/device/armadeus/apf9328/apf9328_defconfig 2009-03-11 14:53:27 UTC (rev 1146)
+++ trunk/buildroot/target/device/armadeus/apf9328/apf9328_defconfig 2009-03-11 16:11:05 UTC (rev 1147)
@@ -1,6 +1,6 @@
#
# Automatically generated make config: don't edit
-# Tue Feb 24 18:01:21 2009
+# Wed Mar 11 17:08:11 2009
#
BR2_HAVE_DOT_CONFIG=y
BR2_VERSION="0.10.0-svn"
@@ -358,6 +358,7 @@
# BR2_PACKAGE_STARTUP_NOTIFICATION is not set
# BR2_PACKAGE_STRACE is not set
# BR2_PACKAGE_SUDO is not set
+# BR2_PACKAGE_XENOMAI is not set
# BR2_DATABASE_SUPPORT is not set
BR2_NETWORK_SUPPORT=y
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-03-11 14:53:38
|
Revision: 1146
http://armadeus.svn.sourceforge.net/armadeus/?rev=1146&view=rev
Author: artemys
Date: 2009-03-11 14:53:27 +0000 (Wed, 11 Mar 2009)
Log Message:
-----------
[BUILDROOT] Add a (fake) package to buildroot in order to install scripts useful for our custom drivers (for the moment only loadgpio.sh/gpio is concerned)
Added Paths:
-----------
trunk/buildroot/package/armadeus-drivers-helpers/
trunk/buildroot/package/armadeus-drivers-helpers/drivers-helpers.mk
Added: trunk/buildroot/package/armadeus-drivers-helpers/drivers-helpers.mk
===================================================================
--- trunk/buildroot/package/armadeus-drivers-helpers/drivers-helpers.mk (rev 0)
+++ trunk/buildroot/package/armadeus-drivers-helpers/drivers-helpers.mk 2009-03-11 14:53:27 UTC (rev 1146)
@@ -0,0 +1,28 @@
+#############################################################
+#
+# Armadeus Helpers script for loading Linux drivers
+#
+#############################################################
+
+ARMADEUS-DRIVERS_SOURCE_DIR:=$(BUILD_DIR)/../../target/linux/modules
+ARMADEUS-DRIVERS-HELPERS_TARGET_DIR:=$(TARGET_DIR)/usr/bin
+
+
+$(ARMADEUS-DRIVERS-HELPERS_TARGET_DIR)/loadgpio.sh:
+ cp $(ARMADEUS-DRIVERS_SOURCE_DIR)/gpio/loadgpio.sh $(ARMADEUS-DRIVERS-HELPERS_TARGET_DIR)/
+# find $(ARMADEUS-TESTSUITE_DIR) -name "*.sh" -exec install -D {} $(TARGET_DIR)/$(ARMADEUS-TESTSUITE_TARGET_DIR) \;
+
+armadeus-drivers-helpers: $(ARMADEUS-DRIVERS-HELPERS_TARGET_DIR)/loadgpio.sh
+
+armadeus-drivers-helpers-clean:
+ rm -f $(ARMADEUS-DRIVERS-HELPERS_TARGET_DIR)/loadgpio.sh
+
+
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+# Always installed by default
+TARGETS+=armadeus-drivers-helpers
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-03-11 14:49:11
|
Revision: 1145
http://armadeus.svn.sourceforge.net/armadeus/?rev=1145&view=rev
Author: artemys
Date: 2009-03-11 14:49:03 +0000 (Wed, 11 Mar 2009)
Log Message:
-----------
[TEST] Add script (very basic) to test gpio driver
Added Paths:
-----------
trunk/target/test/test_gpio.sh
Added: trunk/target/test/test_gpio.sh
===================================================================
--- trunk/target/test/test_gpio.sh (rev 0)
+++ trunk/target/test/test_gpio.sh 2009-03-11 14:49:03 UTC (rev 1145)
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+#
+# Script to test Armadeus Software release
+#
+# Copyright (C) 2008-2009 The Armadeus Project
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+
+source ./test_helpers.sh
+source ./test_env.sh
+
+GPIO_DEV_DIR=/dev/gpio
+GPIO_PROC_DIR=/proc/driver/gpio
+
+blink_led_apf27()
+{
+ cat $GPIO_PROC_DIR/portFdir | sed "s/[0-1]\([0-1]\{14\}\)$/1\1/" > $GPIO_PROC_DIR/portFdir
+ for i in `seq 0 5`; do
+ echo -ne "\x01" > /dev/gpio/PF14
+ usleep 500000
+ echo -ne "\x00" > /dev/gpio/PF14
+ usleep 500000
+ done
+}
+
+blink_led_apf9328()
+{
+ cat $GPIO_PROC_DIR/portDdir | sed "s/[0-1]\([0-1]\{31\}\)$/1\1/" > $GPIO_PROC_DIR/portDdir
+ for i in `seq 0 5`; do
+ echo -ne "\x00" > $GPIO_DEV_DIR/PD31
+ usleep 500000
+ echo -ne "\x01" > $GPIO_DEV_DIR/PD31
+ usleep 500000
+ done
+}
+
+test_led_gpio()
+{
+ show_test_banner "GPIO (LED)"
+
+ loadgpio.sh
+ if [ "$?" != 0 ] || [ ! -c "$GPIO_DEV_DIR/portA" ] ; then
+ echo "Module failed to load"
+ exit_failed
+ fi
+
+ BOARD=`cat /etc/machine`
+ if [ "$BOARD" == "APF9328" ]; then
+ blink_led_apf9328
+ fi
+ if [ "$BOARD" == "APF27" ]; then
+ blink_led_apf27
+ fi
+
+ ask_user "Did you see a LED blinking ? (y/n)"
+ if [ "$response" != "y" ]; then
+ exit_failed
+ fi
+ echo_test_ok
+ exit 0
+}
+
+test_led_gpio
Property changes on: trunk/target/test/test_gpio.sh
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-03-11 14:20:57
|
Revision: 1144
http://armadeus.svn.sourceforge.net/armadeus/?rev=1144&view=rev
Author: artemys
Date: 2009-03-11 14:20:34 +0000 (Wed, 11 Mar 2009)
Log Message:
-----------
[LINUX] Makes gpio driver compatible with APF27 + some cleanup
Modified Paths:
--------------
trunk/target/linux/modules/gpio/core.c
trunk/target/linux/modules/gpio/core.h
trunk/target/linux/modules/gpio/loadgpio.sh
Property Changed:
----------------
trunk/target/linux/modules/gpio/loadgpio.sh
Modified: trunk/target/linux/modules/gpio/core.c
===================================================================
--- trunk/target/linux/modules/gpio/core.c 2009-03-11 14:04:26 UTC (rev 1143)
+++ trunk/target/linux/modules/gpio/core.c 2009-03-11 14:20:34 UTC (rev 1144)
@@ -1,8 +1,9 @@
/*
* Armadeus i.MXL GPIO management driver
*
- * Copyright (C) 2006-2008 Armadeus Project / Armadeus Systems
- * Authors: Nicolas Colombain / Julien Boibessot
+ * Copyright (C) 2006-2008 Julien Boibessot <jul...@ar...>
+ * Nicolas Colombain <nic...@ar...>
+ * Armadeus Project / Armadeus Systems
*
* Inspired by a lot of other GPIO management systems...
*
@@ -22,30 +23,69 @@
*
*/
-#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
-#include <asm/arch/imx-regs.h>
-#else
-#include <mach/imx-regs.h>
-#endif
-
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
-#include "core.h" // TBDJUJU: put core.h contents here....
+#include <linux/proc_fs.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <linux/interrupt.h> /* request_irq */
+#include <asm/gpio.h> /* imx_gpio_... */
+#include <linux/cdev.h> /* struct cdev */
+#include <mach/hardware.h>
+#include <asm/mach/map.h>
+#ifdef CONFIG_ARCH_MX2
+#include <mach/iomux-mx1-mx2.h>
+#endif
+#ifdef CONFIG_ARCH_IMX /* TO BE REMOVED WHEN MX1 PLATFORM EXIST */
+#define VA_GPIO_BASE IO_ADDRESS(IMX_GPIO_BASE)
+#define MXC_DDIR(x) (0x00 + ((x) << 8))
+#define MXC_OCR1(x) (0x04 + ((x) << 8))
+#define MXC_OCR2(x) (0x08 + ((x) << 8))
+#define MXC_ICONFA1(x) (0x0c + ((x) << 8))
+#define MXC_ICONFA2(x) (0x10 + ((x) << 8))
+#define MXC_ICONFB1(x) (0x14 + ((x) << 8))
+#define MXC_ICONFB2(x) (0x18 + ((x) << 8))
+#define MXC_DR(x) (0x1c + ((x) << 8))
+#define MXC_GIUS(x) (0x20 + ((x) << 8))
+#define MXC_SSR(x) (0x24 + ((x) << 8))
+#define MXC_ICR1(x) (0x28 + ((x) << 8))
+#define MXC_ICR2(x) (0x2c + ((x) << 8))
+#define MXC_IMR(x) (0x30 + ((x) << 8))
+#define MXC_ISR(x) (0x34 + ((x) << 8))
+#define MXC_GPR(x) (0x38 + ((x) << 8))
+#define MXC_SWR(x) (0x3c + ((x) << 8))
+#define MXC_PUEN(x) (0x40 + ((x) << 8))
+#endif
+#include "core.h" /* for ioctl defs */
+
+#define DRIVER_NAME "Armadeus GPIOs driver"
+#define DRIVER_VERSION "v2.1"
+/* By default, we use dynamic allocation of major numbers -> MAJOR = 0 */
+#define GPIO_MAJOR 0
+#define GPIO_PROC_DIRNAME "driver/gpio"
+
#define GPIO_PROC_FILE 1
#define SETTINGS_PROC_FILE (1 << 3)
#define SETTINGS_IRQ_PROC_FILE (1 << 4)
#define SETTINGS_PULLUP_PROC_FILE (1 << 5)
+#define MAX_NUMBER_OF_PINS 32
+
#define PORT_A 0
#define PORT_B 1
#define PORT_C 2
#define PORT_D 3
+#ifdef CONFIG_ARCH_IMX
#define NB_PORTS 4
-#define PORT_MAX_ID 4
+#endif
+#ifdef CONFIG_ARCH_MX2
+#define PORT_E 4
+#define PORT_F 5
+#define NB_PORTS 6
+#endif
#define MAX_MINOR (255) /* Linux limitation */
@@ -53,34 +93,41 @@
#define FULL_PORTB_MINOR (MAX_MINOR - PORT_B)
#define FULL_PORTC_MINOR (MAX_MINOR - PORT_C)
#define FULL_PORTD_MINOR (MAX_MINOR - PORT_D)
-
+#ifndef CONFIG_ARCH_IMX
+#define FULL_PORTE_MINOR (MAX_MINOR - PORT_E)
+#define FULL_PORTF_MINOR (MAX_MINOR - PORT_F)
+#endif
#define FULL_MINOR_TO_PORT(x) (MAX_MINOR - x)
/* Parameters order: */
enum {
- DDIR_I = 0,
- OCR1_I,
- OCR2_I,
- ICONFA1_I,
- ICONFA2_I,
- ICONFB1_I,
- ICONFB2_I,
- DR_I,
- GIUS_I,
- SSR_I,
- ICR1_I,
- ICR2_I,
- IMR_I,
- GPR_I,
- SWR_I,
- PUEN_I,
+ DDIR_I = 0,
+ OCR1_I,
+ OCR2_I,
+ ICONFA1_I,
+ ICONFA2_I,
+ ICONFB1_I,
+ ICONFB2_I,
+ DR_I,
+ GIUS_I,
+ SSR_I,
+ ICR1_I,
+ ICR2_I,
+ IMR_I,
+ GPR_I,
+ SWR_I,
+ PUEN_I,
};
/* Global variables */
struct gpio_operations *driver_ops;
static int gpio_major = GPIO_MAJOR;
-static int number_of_pins[4] = {32, 32, 32, 32};
+#ifdef CONFIG_ARCH_IMX
+static int number_of_pins[NB_PORTS] = {32, 32, 32, 32};
+#else
+static int number_of_pins[NB_PORTS] = {32, 32, 32, 32, 32, 32};
+#endif
static unsigned long init_map;
struct semaphore gpio_sema;
@@ -111,8 +158,15 @@
static int portD_init[NB_CONFIG_REGS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
static int portD_init_nb = 0;
module_param_array( portD_init, int, &portD_init_nb, 0000 );
+#ifndef CONFIG_ARCH_IMX
+static int portE_init[NB_CONFIG_REGS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+static int portE_init_nb = 0;
+module_param_array( portE_init, int, &portE_init_nb, 0000 );
+static int portF_init[NB_CONFIG_REGS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+static int portF_init_nb = 0;
+module_param_array( portF_init, int, &portF_init_nb, 0000 );
+#endif
-
struct gpio_item {
spinlock_t lock;
@@ -137,7 +191,11 @@
/* struct config_item item; TBDJUJU: Use configfs filesystem ! */
};
+#ifdef CONFIG_ARCH_IMX
static unsigned int shadows_irq[NB_PORTS] = { 0, 0, 0, 0 };
+#else
+static unsigned int shadows_irq[NB_PORTS] = { 0, 0, 0, 0, 0, 0 };
+#endif
/* Static functions */
@@ -149,7 +207,7 @@
static int i;
/* convert it into a string */
- for (i=number_of_bits;i>0;i--) {
+ for (i = number_of_bits; i > 0; i--) {
buffer[number_of_bits-i]=test_bit(i-1,&value)?'1':'0';
}
@@ -186,37 +244,71 @@
/*
* Low level functions
*/
-#define DEFAULT_VALUE 0x12345678
/* These masks are for restricting user access to configuration of some
criticals GPIO pins used by Armadeus and not configurable */
-static unsigned long MASK[]= { 0x0003FFFE, 0xF00FFF00, 0x0003E1F8, 0xFFFFFFFF };
-#define PORT_A_MASK 0x0003FFFE
-#define PORT_B_MASK 0xF00FFF00
-#define PORT_C_MASK 0x0003E1F8
-#define PORT_D_MASK 0xFFFFFFFF
+#ifdef CONFIG_ARCH_IMX
+static unsigned long PORT_MASK[]= { 0x0003FFFE, 0xF00FFF00, 0x0003E1F8, 0xFFFFFFFF };
+#else
+static unsigned long PORT_MASK[]= { 0x0003FFFE, 0xF00FFF00, 0x0003E1F8, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
+#endif
static void initialize_port(int port, int* init_params)
{
- unsigned long lTemp;
-
+ u32 lTemp;
+
/* Initialize PORT with module parameters */
- if (init_params[DR_I]) { DR(port) = init_params[DR_I]; }
- if (init_params[SSR_I]) { SSR(port) = init_params[SSR_I]; }
- if (init_params[OCR1_I]) { OCR1(port) = init_params[OCR1_I]; }
+ if (init_params[DR_I]) {
+ __raw_writel(init_params[DR_I], VA_GPIO_BASE + MXC_DR(port));
+ }
+ if (init_params[SSR_I]) {
+ __raw_writel(init_params[SSR_I], VA_GPIO_BASE + MXC_SSR(port));
+ }
+ if (init_params[OCR1_I]) {
+ __raw_writel(init_params[OCR1_I], VA_GPIO_BASE + MXC_OCR1(port));
+ }
/*else { default value are already set by iMX !!*/
- if (init_params[OCR2_I]) { OCR2(port) = init_params[OCR2_I]; }
- if (init_params[ICONFA1_I]) { ICONFA1(port) = init_params[ICONFA1_I]; }
- if (init_params[ICONFA2_I]) { ICONFA2(port) = init_params[ICONFA2_I]; }
- if (init_params[ICONFB1_I]) { ICONFB1(port) = init_params[ICONFB1_I]; }
- if (init_params[ICONFB2_I]) { ICONFB2(port) = init_params[ICONFB2_I]; }
- if (init_params[DDIR_I]) { DDIR(port) = init_params[DDIR_I]; }
- if (init_params[SWR_I]) { SWR(port) = init_params[SWR_I]; }
- if (init_params[GPR_I]) { lTemp = GPR(port) & (~MASK[port]); GPR(port) = lTemp | (init_params[GPR_I] & MASK[port]); }
- if (init_params[GIUS_I]) { lTemp = GIUS(port) & (~MASK[port]); GIUS(port) = lTemp | (init_params[GIUS_I] & MASK[port]); }
- if (init_params[PUEN_I]) { lTemp = PUEN(port) & (~MASK[port]); PUEN(port) = lTemp | (init_params[PUEN_I] & MASK[port]); }
- if (init_params[ICR1_I]) { ICR1(port) = init_params[ICR1_I]; }
- if (init_params[ICR2_I]) { ICR2(port) = init_params[ICR2_I]; }
- if (init_params[IMR_I]) { IMR(port) = init_params[IMR_I]; }
+ if (init_params[OCR2_I]) {
+ __raw_writel(init_params[OCR2_I], VA_GPIO_BASE + MXC_OCR2(port));
+ }
+ if (init_params[ICONFA1_I]) {
+ __raw_writel(init_params[ICONFA1_I], VA_GPIO_BASE + MXC_ICONFA1(port));
+ }
+ if (init_params[ICONFA2_I]) {
+ __raw_writel(init_params[ICONFA2_I], VA_GPIO_BASE + MXC_ICONFA2(port));
+ }
+ if (init_params[ICONFB1_I]) {
+ __raw_writel(init_params[ICONFB1_I], VA_GPIO_BASE + MXC_ICONFB1(port));
+ }
+ if (init_params[ICONFB2_I]) {
+ __raw_writel(init_params[ICONFB2_I], VA_GPIO_BASE + MXC_ICONFB2(port));
+ }
+ if (init_params[DDIR_I]) {
+ __raw_writel(init_params[DDIR_I], VA_GPIO_BASE + MXC_DDIR(port));
+ }
+ if (init_params[SWR_I]) {
+ __raw_writel(init_params[SWR_I], VA_GPIO_BASE + MXC_SWR(port));
+ }
+ if (init_params[GPR_I]) {
+ lTemp = __raw_readl(VA_GPIO_BASE + MXC_GPR(port)) & (~PORT_MASK[port]);
+ __raw_writel(lTemp | (init_params[GPR_I] & PORT_MASK[port]), VA_GPIO_BASE + MXC_GPR(port));
+ }
+ if (init_params[GIUS_I]) {
+ lTemp = __raw_readl(VA_GPIO_BASE + MXC_GIUS(port)) & (~PORT_MASK[port]);
+ __raw_writel(lTemp | (init_params[GIUS_I] & PORT_MASK[port]), VA_GPIO_BASE + MXC_GIUS(port));
+ }
+ if (init_params[PUEN_I]) {
+ lTemp = __raw_readl(VA_GPIO_BASE + MXC_PUEN(port)) & (~PORT_MASK[port]);
+ __raw_writel(lTemp | (init_params[PUEN_I] & PORT_MASK[port]), VA_GPIO_BASE + MXC_PUEN(port));
+ }
+ if (init_params[ICR1_I]) {
+ __raw_writel(init_params[ICR1_I], VA_GPIO_BASE + MXC_ICR1(port));
+ }
+ if (init_params[ICR2_I]) {
+ __raw_writel(init_params[ICR2_I], VA_GPIO_BASE + MXC_ICR2(port));
+ }
+ if (init_params[IMR_I]) {
+ __raw_writel(init_params[IMR_I], VA_GPIO_BASE + MXC_IMR(port));
+ }
}
static void initialize_all_ports( void )
@@ -225,14 +317,16 @@
initialize_port(PORT_B, portB_init);
initialize_port(PORT_C, portC_init);
initialize_port(PORT_D, portD_init);
+#ifndef CONFIG_ARCH_IMX
+ initialize_port(PORT_E, portE_init);
+ initialize_port(PORT_F, portF_init);
+#endif
}
-/* TBDJUJU: replace the following functions with imx_gpio_xxx one !! */
-
static void writeOnPort( unsigned int aPort, unsigned int aValue )
{
- DR(aPort) = (aValue & MASK[aPort]);
+ __raw_writel(aValue & PORT_MASK[aPort], VA_GPIO_BASE + MXC_DR(aPort));
}
static unsigned int readFromPort( unsigned int aPort )
@@ -240,27 +334,32 @@
unsigned int port_value = 0;
/* Get the status of the gpio ports */
- port_value = (SSR(aPort));
+ port_value = __raw_readl(VA_GPIO_BASE + MXC_SSR(aPort));
- return( port_value );
+ return port_value;
}
static void setPortDir( unsigned int aPort, unsigned int aDirMask )
{
- DDIR(aPort) = (aDirMask & 0xffffffff);
+ __raw_writel(aDirMask & 0xffffffff, VA_GPIO_BASE + MXC_DDIR(aPort));
}
static unsigned int getPortDir( unsigned int aPort )
{
unsigned int port_value = 0;
-
+
/* Get the status of the gpio direction registers TBDNICO */
- port_value = (DDIR(aPort));
-
- return( port_value );
+ port_value = __raw_readl(VA_GPIO_BASE + MXC_DDIR(aPort));
+
+ return port_value;
}
-char* port_name[NB_PORTS] = { "PortA", "PortB", "PortC", "PortD" };
+
+char* port_name[NB_PORTS] = { "portA", "portB", "portC", "portD",
+#ifdef CONFIG_ARCH_MX2
+ "portE", "portF",
+#endif
+};
char* port_setting_name[4] = { "Value", "Direction", "Pull-up", "Interrupt" };
@@ -274,10 +373,11 @@
minor = MINOR(file->f_dentry->d_inode->i_rdev);
- pr_debug("- %s %d byte(s) on minor %d -> %s pin %d\n", __FUNCTION__, count, minor, port_name[gpio->port], gpio->number);
+ pr_debug("- %s %d byte(s) on minor %d -> %s pin %d\n", __FUNCTION__,
+ count, minor, port_name[gpio->port], gpio->number);
if (down_interruptible(&gpio_sema)) /* Usefull ?? */
- return -ERESTARTSYS;
+ return -ERESTARTSYS;
count = min(count, (size_t)4);
if (copy_from_user(&value, data, count)) {
@@ -291,7 +391,7 @@
} else {
value = value ? 1 : 0;
pr_debug("Single pin write: %d\n", value);
- imx_gpio_set_value( minor, value );
+ gpio_set_value(minor, value);
}
ret = count;
@@ -335,7 +435,7 @@
value = readFromPort( gpio->port );
pr_debug("Full port read: 0x%x\n", value);
} else {
- value = imx_gpio_get_value( minor );
+ value = gpio_get_value(minor);
pr_debug("Single pin read: %d\n", value);
}
@@ -363,7 +463,7 @@
printk("IT for pin %d %d\n", gpio->port, gpio->number);
old_state = gpio->pin_state;
- new_state = imx_gpio_get_value( gpio->port|gpio->number );
+ new_state = gpio_get_value(gpio->port|gpio->number);
gpio->pin_state = new_state;
if (new_state != old_state) {
@@ -381,7 +481,7 @@
static int armadeus_gpio_dev_open(struct inode *inode, struct file *file)
{
unsigned minor = MINOR(inode->i_rdev);
- unsigned int major = MAJOR(inode->i_rdev);
+ /*unsigned int major = MAJOR(inode->i_rdev);*/
unsigned int irq;
int ret = 0;
struct gpio_item *gpio;/* = container_of(inode->i_cdev, struct gpio_item,
@@ -395,13 +495,16 @@
spin_lock_init(&gpio->lock);
init_waitqueue_head(&gpio->change_wq);
- switch (minor)
- {
+ switch (minor) {
/* Write all port pins in one time */
case FULL_PORTA_MINOR:
case FULL_PORTB_MINOR:
case FULL_PORTC_MINOR:
case FULL_PORTD_MINOR:
+#ifndef CONFIG_ARCH_IMX
+ case FULL_PORTE_MINOR:
+ case FULL_PORTF_MINOR:
+#endif
gpio->nb_pins = 32;
gpio->changed = 1;
gpio->port = FULL_MINOR_TO_PORT(minor);
@@ -414,31 +517,33 @@
gpio->nb_pins = 1;
gpio->changed = 1;
- if( imx_gpio_request(minor, "gpio-dev") )
+ if ((ret = gpio_request(minor, "gpio-dev"))) {
+ printk("GPIO %i is already in use\n", minor);
goto err_request;
+ }
gpio->port = minor >> GPIO_PORT_SHIFT;
gpio->number = minor & GPIO_PIN_MASK;
gpio->pin_state = 0;
- if( getPortDir(gpio->port) & (1 << gpio->number) ) {
- imx_gpio_direction_output( minor, 0 );
+ if (getPortDir(gpio->port) & (1 << gpio->number)) {
+ gpio_direction_output( minor, 0 );
} else {
- imx_gpio_direction_input( minor );
- gpio->pin_state = imx_gpio_get_value( minor );
+ gpio_direction_input( minor );
+ gpio->pin_state = gpio_get_value( minor );
}
/* Request interrupt if pin was configured for */
- if (shadows_irq[gpio->port] & (1 << gpio->number) ) {
+ if (shadows_irq[gpio->port] & (1 << gpio->number)) {
irq = IRQ_GPIOA(minor); /* irq number are continuous */
- ret = request_irq( irq, armadeus_gpio_interrupt, 0, "gpio", gpio );
- if( ret )
+ ret = request_irq(irq, armadeus_gpio_interrupt, 0, "gpio", gpio);
+ if (ret)
goto err_irq;
/* set_irq_type( irq, IRQF_TRIGGER_FALLING ); TDBJUJU */
}
success:
- printk("Opening /dev/gpio%d/%d file port:%d pin:%d\n", major, minor, gpio->port, gpio->number);
+ printk("Opening /dev node for %s pin %d\n", port_name[gpio->port], gpio->number);
gpio->initialized = 1;
return 0;
@@ -458,15 +563,15 @@
struct gpio_item *gpio = file->private_data;
unsigned int irq;
- if( gpio->initialized ) {
+ if (gpio->initialized) {
if (shadows_irq[gpio->port] & (1 << gpio->number) ) {
irq = IRQ_GPIOA(minor);
- free_irq( irq, gpio );
+ free_irq(irq, gpio);
}
- imx_gpio_free( minor );
+ gpio_free(minor);
}
kfree(gpio);
- printk("Closing access to /dev/gpio%d\n", minor);
+ printk("Closing access to /dev/gpio/ minor %d\n", minor);
return 0;
}
@@ -483,8 +588,9 @@
/* Extract the type and number bitfields, and don't decode wrong cmds:
return ENOTTY (inappropriate ioctl) before access_ok() */
- if (_IOC_TYPE(cmd) != PP_IOCTL) return -ENOTTY;
-
+ if (_IOC_TYPE(cmd) != PP_IOCTL)
+ return -ENOTTY;
+
/* The direction is a bitmask, and VERIFY_WRITE catches R/W transfers.
`Type' is user-oriented, while access_ok is kernel-oriented,
so the concept of "read" and "write" is reversed */
@@ -505,8 +611,7 @@
return -EFAULT;
}
- switch(cmd)
- {
+ switch (cmd) {
case GPIORDDIRECTION:
value = getPortDir( minor );
ret = __put_user(value, (unsigned int *)arg);
@@ -515,7 +620,7 @@
case GPIOWRDIRECTION:
ret = __get_user(value, (unsigned int *)arg);
- if (ret==0) {
+ if (ret == 0) {
setPortDir( minor, value );
}
break;
@@ -538,7 +643,7 @@
}
/* Release exclusive access */
up(&gpio_sema);
-
+
return ret;
}
@@ -571,8 +676,7 @@
if (down_interruptible(&gpio_sema))
return -ERESTARTSYS;
- switch( settings->type )
- {
+ switch (settings->type) {
case VALUE:
port_status = readFromPort( port_ID );
break;
@@ -584,7 +688,7 @@
break;
case PULL_UP:
- port_status = PUEN(port_ID);
+ port_status = __raw_readl(VA_GPIO_BASE + MXC_PUEN(port_ID));
printk("pull-up\n");
break;
@@ -635,7 +739,7 @@
}
/* Get exclusive access to port */
- if( down_interruptible(&gpio_sema) )
+ if (down_interruptible(&gpio_sema))
return -ERESTARTSYS;
/* Get datas to write from user space */
@@ -644,8 +748,7 @@
return -EFAULT;
}
- if( strlen(new_gpio_state) > 0 )
- {
+ if (strlen(new_gpio_state) > 0) {
/* Convert it from String to Int */
gpio_state = fromString( new_gpio_state, number_of_pins[port_ID] );
@@ -677,7 +780,7 @@
printk("/proc wrote 0x%x on %s %s register\n", gpio_state,
port_name[port_ID], port_setting_name[settings->type]);
- }
+ }
up(&gpio_sema);
/* Makes as if we take all the data sent even if we can't handle more
@@ -689,17 +792,16 @@
/* /proc registering helpers */
struct proc_config_entry {
struct proc_dir_entry *entry;
- char* name;
+ char name[32];
int port;
int type;
};
-static int initialize_entry( struct proc_config_entry *config )
+static int initialize_proc_entry( struct proc_config_entry *config )
{
int i;
- for (i = 0; i < 4; i++)
- {
+ for (i = 0; i < NB_PORTS; i++) {
config[i].entry = create_proc_entry( config[i].name, S_IWUSR |S_IRUSR | S_IRGRP | S_IROTH, NULL);
if (config[i].entry == NULL) {
printk(KERN_ERR DRIVER_NAME ": Couldn't register %s. Terminating.\n", config[i].name);
@@ -722,103 +824,91 @@
static int create_proc_entries(void)
{
struct proc_config_entry proc_config[NB_PORTS];
- int ret;
+ int ret, i;
- printk("Creating /proc entries: ");
+ pr_debug("Creating /proc entries: ");
/* Create main directory */
proc_mkdir(GPIO_PROC_DIRNAME, NULL);
/* Create proc file to handle GPIO values */
- proc_config[PORT_A].name = GPIO_PROC_PORTA_FILENAME;
- proc_config[PORT_A].type = VALUE;
- proc_config[PORT_B].name = GPIO_PROC_PORTB_FILENAME;
- proc_config[PORT_B].type = VALUE;
- proc_config[PORT_C].name = GPIO_PROC_PORTC_FILENAME;
- proc_config[PORT_C].type = VALUE;
- proc_config[PORT_D].name = GPIO_PROC_PORTD_FILENAME;
- proc_config[PORT_D].type = VALUE;
+ for (i = 0; i < NB_PORTS; i++) {
+ sprintf(proc_config[i].name, "%s/%s", GPIO_PROC_DIRNAME, port_name[i]);
+ proc_config[i].type = VALUE;
+ }
- if ((ret = initialize_entry(proc_config)))
+ if ((ret = initialize_proc_entry(proc_config)))
return ret;
init_map |= GPIO_PROC_FILE;
/* Create proc file to handle GPIO direction settings */
- proc_config[PORT_A].name = GPIO_PROC_PORTADIR_FILENAME;
- proc_config[PORT_A].type = DIRECTION;
- proc_config[PORT_B].name = GPIO_PROC_PORTBDIR_FILENAME;
- proc_config[PORT_B].type = DIRECTION;
- proc_config[PORT_C].name = GPIO_PROC_PORTCDIR_FILENAME;
- proc_config[PORT_C].type = DIRECTION;
- proc_config[PORT_D].name = GPIO_PROC_PORTDDIR_FILENAME;
- proc_config[PORT_D].type = DIRECTION;
+ for (i = 0; i < NB_PORTS; i++) {
+ sprintf(proc_config[i].name, "%s/%sdir", GPIO_PROC_DIRNAME, port_name[i]);
+ proc_config[i].type = DIRECTION;
+ }
- if ((ret = initialize_entry(proc_config)))
+ if ((ret = initialize_proc_entry(proc_config)))
return ret;
init_map |= SETTINGS_PROC_FILE;
/* Create proc file to handle GPIO interrupt settings */
- proc_config[PORT_A].name = GPIO_PROC_PORTA_IRQ_FILENAME;
- proc_config[PORT_A].type = INTERRUPT;
- proc_config[PORT_B].name = GPIO_PROC_PORTB_IRQ_FILENAME;
- proc_config[PORT_B].type = INTERRUPT;
- proc_config[PORT_C].name = GPIO_PROC_PORTC_IRQ_FILENAME;
- proc_config[PORT_C].type = INTERRUPT;
- proc_config[PORT_D].name = GPIO_PROC_PORTD_IRQ_FILENAME;
- proc_config[PORT_D].type = INTERRUPT;
+ for (i = 0; i < NB_PORTS; i++) {
+ sprintf(proc_config[i].name, "%s/%sirq", GPIO_PROC_DIRNAME, port_name[i]);
+ proc_config[i].type = DIRECTION;
+ }
- if ((ret = initialize_entry(proc_config)))
+ if ((ret = initialize_proc_entry(proc_config)))
return ret;
init_map |= SETTINGS_IRQ_PROC_FILE;
/* Create proc file to handle GPIO pullup settings */
- proc_config[PORT_A].name = GPIO_PROC_PORTA_PULLUP_FILENAME;
- proc_config[PORT_A].type = PULL_UP;
- proc_config[PORT_B].name = GPIO_PROC_PORTB_PULLUP_FILENAME;
- proc_config[PORT_B].type = PULL_UP;
- proc_config[PORT_C].name = GPIO_PROC_PORTC_PULLUP_FILENAME;
- proc_config[PORT_C].type = PULL_UP;
- proc_config[PORT_D].name = GPIO_PROC_PORTD_PULLUP_FILENAME;
- proc_config[PORT_D].type = PULL_UP;
+ for (i = 0; i < NB_PORTS; i++) {
+ sprintf(proc_config[i].name, "%s/%spullup", GPIO_PROC_DIRNAME, port_name[i]);
+ proc_config[i].type = DIRECTION;
+ }
- if ((ret = initialize_entry(proc_config)))
+ if ((ret = initialize_proc_entry(proc_config)))
return ret;
init_map |= SETTINGS_PULLUP_PROC_FILE;
- printk("OK!\n");
- return(0);
+ pr_debug("OK!\n");
+
+ return 0;
}
static void remove_proc_entries(void)
{
+ char proc_name[32];
+ int i;
+
/* Remove /proc entries */
if (init_map & GPIO_PROC_FILE) {
- printk( DRIVER_NAME " removing " GPIO_PROC_PORTA_FILENAME " & Co\n" );
- remove_proc_entry( GPIO_PROC_PORTA_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTB_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTC_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTD_FILENAME, NULL);
+ printk( DRIVER_NAME " removing /proc/.../portX\n" );
+ for (i = 0; i < NB_PORTS; i++) {
+ sprintf(proc_name, "%s/%s", GPIO_PROC_DIRNAME, port_name[i]);
+ remove_proc_entry(proc_name, NULL);
+ }
}
if (init_map & SETTINGS_PROC_FILE) {
- printk( DRIVER_NAME " removing " GPIO_PROC_PORTADIR_FILENAME " & Co\n" );
- remove_proc_entry( GPIO_PROC_PORTADIR_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTBDIR_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTCDIR_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTDDIR_FILENAME, NULL);
+ printk( DRIVER_NAME " removing /proc/.../portXdir\n" );
+ for (i = 0; i < NB_PORTS; i++) {
+ sprintf(proc_name, "%s/%sdir", GPIO_PROC_DIRNAME, port_name[i]);
+ remove_proc_entry(proc_name, NULL);
+ }
}
if (init_map & SETTINGS_IRQ_PROC_FILE) {
- printk( DRIVER_NAME " removing " GPIO_PROC_PORTA_IRQ_FILENAME " & Co\n" );
- remove_proc_entry( GPIO_PROC_PORTA_IRQ_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTB_IRQ_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTC_IRQ_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTD_IRQ_FILENAME, NULL);
+ printk( DRIVER_NAME " removing /proc/.../portXirq\n" );
+ for (i = 0; i < NB_PORTS; i++) {
+ sprintf(proc_name, "%s/%sirq", GPIO_PROC_DIRNAME, port_name[i]);
+ remove_proc_entry(proc_name, NULL);
+ }
}
if (init_map & SETTINGS_PULLUP_PROC_FILE) {
- printk( DRIVER_NAME " removing " GPIO_PROC_PORTA_PULLUP_FILENAME " & Co\n" );
- remove_proc_entry( GPIO_PROC_PORTA_PULLUP_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTB_PULLUP_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTC_PULLUP_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTD_PULLUP_FILENAME, NULL);
+ printk( DRIVER_NAME " removing /proc/.../portXpullup\n" );
+ for (i = 0; i < NB_PORTS; i++) {
+ sprintf(proc_name, "%s/%spullup", GPIO_PROC_DIRNAME, port_name[i]);
+ remove_proc_entry(proc_name, NULL);
+ }
}
remove_proc_entry(GPIO_PROC_DIRNAME, NULL);
@@ -834,20 +924,31 @@
.ioctl = armadeus_gpio_dev_ioctl,
};
+static void print_port_params(int port, int nb, int* params)
+{
+ int i;
+
+ printk(" %s Parameters (%i): ", port_name[port], nb);
+ for (i = 0; i < NB_CONFIG_REGS; i++) {
+ printk(" 0x%x", params[i]);
+ }
+ printk("\n");
+}
+
/* Module's initialization */
static int __init armadeus_gpio_init(void)
{
- static int result, i;
-
+ static int result;
+
printk("Initializing Armadeus GPIOs driver\n");
- printk(" PortA Parameters (%i): ", portA_init_nb);
- for (i = 0; i < NB_CONFIG_REGS; i++) { printk(" 0x%x", portA_init[i]); } printk("\n");
- printk(" PortB Parameters (%i): ", portB_init_nb);
- for (i = 0; i < NB_CONFIG_REGS; i++ ) { printk(" 0x%x", portB_init[i]); } printk("\n");
- printk(" PortC Parameters (%i): ", portC_init_nb);
- for (i = 0; i < NB_CONFIG_REGS; i++ ) { printk(" 0x%x", portC_init[i]); } printk("\n");
- printk(" PortD Parameters (%i): ", portD_init_nb);
- for (i = 0; i < NB_CONFIG_REGS; i++ ) { printk(" 0x%x", portD_init[i]); } printk("\n");
+ print_port_params(PORT_A, portA_init_nb, portA_init);
+ print_port_params(PORT_B, portB_init_nb, portB_init);
+ print_port_params(PORT_C, portC_init_nb, portC_init);
+ print_port_params(PORT_D, portD_init_nb, portD_init);
+#ifdef CONFIG_ARCH_MX2
+ print_port_params(PORT_E, portE_init_nb, portE_init);
+ print_port_params(PORT_F, portF_init_nb, portF_init);
+#endif
init_map = 0;
/* Configure HW ports/GPIOs with default values or given parameters */
@@ -891,26 +992,27 @@
*/
void gpioWriteOnPort( unsigned int aPort, unsigned int aValue )
{
- if( aPort >= NB_PORTS ) { aPort = NB_PORTS - 1; printk(DRIVER_NAME "port unknown !\n"); return; }
- //
- writeOnPort( aPort, aValue );
+ if (aPort >= NB_PORTS) { aPort = NB_PORTS - 1; printk(DRIVER_NAME "port unknown !\n"); return; }
+ //
+ writeOnPort( aPort, aValue );
}
unsigned int gpioReadFromPort( unsigned int aPort )
{
- if( aPort >= NB_PORTS ) { aPort = NB_PORTS - 1; printk(DRIVER_NAME "port unknown !\n"); return(0); }
- else
- return( readFromPort( aPort ) );
+ if (aPort >= NB_PORTS) {
+ aPort = NB_PORTS - 1; printk(DRIVER_NAME "port unknown !\n"); return(0);
+ } else
+ return (readFromPort( aPort ));
}
void gpioSetPortDir( unsigned int aPort, unsigned int aDirMask )
{
- setPortDir( aPort, aDirMask );
+ setPortDir( aPort, aDirMask );
}
unsigned int gpioGetPortDir( unsigned int aPort )
{
- return( getPortDir( aPort ) );
+ return (getPortDir( aPort ));
}
EXPORT_SYMBOL( gpioWriteOnPort );
Modified: trunk/target/linux/modules/gpio/core.h
===================================================================
--- trunk/target/linux/modules/gpio/core.h 2009-03-11 14:04:26 UTC (rev 1143)
+++ trunk/target/linux/modules/gpio/core.h 2009-03-11 14:20:34 UTC (rev 1144)
@@ -1,5 +1,12 @@
/*
- **********************************************************************
+ * Armadeus i.MXL GPIO management driver
+ *
+ * Copyright (C) 2006-2008 Julien Boibessot <jul...@ar...>
+ * Nicolas Colombain <nic...@ar...>
+ * Armadeus Project / Armadeus Systems
+ *
+ * Inspired by a lot of other GPIO management systems...
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
@@ -13,73 +20,21 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- **********************************************************************
-*/
+ *
+ */
#ifndef __CORE_GPIO_H__
#define __CORE_GPIO_H__
-#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
-#include <linux/config.h>
-#endif
-//#include <config/modversions.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/fs.h>
-#include <linux/errno.h>
-#include <linux/types.h>
-#include <linux/proc_fs.h>
-#include <linux/init.h>
-#include <linux/fs.h>
-#include <linux/fcntl.h>
-#include <asm/system.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <linux/interrupt.h> /* request_irq */
-#include <asm/gpio.h> /* imx_gpio_... */
-#include <linux/cdev.h> /* struct cdev */
-// Proc filenames:
-#define GPIO_PROC_DIRNAME "driver/gpio"
-//
-#define GPIO_PROC_PORTA_FILENAME GPIO_PROC_DIRNAME "/portA"
-#define GPIO_PROC_PORTB_FILENAME GPIO_PROC_DIRNAME "/portB"
-#define GPIO_PROC_PORTC_FILENAME GPIO_PROC_DIRNAME "/portC"
-#define GPIO_PROC_PORTD_FILENAME GPIO_PROC_DIRNAME "/portD"
-//
-#define GPIO_PROC_PORTADIR_FILENAME GPIO_PROC_PORTA_FILENAME "dir"
-#define GPIO_PROC_PORTBDIR_FILENAME GPIO_PROC_PORTB_FILENAME "dir"
-#define GPIO_PROC_PORTCDIR_FILENAME GPIO_PROC_PORTC_FILENAME "dir"
-#define GPIO_PROC_PORTDDIR_FILENAME GPIO_PROC_PORTD_FILENAME "dir"
-
-#define GPIO_PROC_PORTA_IRQ_FILENAME GPIO_PROC_PORTA_FILENAME "irq"
-#define GPIO_PROC_PORTB_IRQ_FILENAME GPIO_PROC_PORTB_FILENAME "irq"
-#define GPIO_PROC_PORTC_IRQ_FILENAME GPIO_PROC_PORTC_FILENAME "irq"
-#define GPIO_PROC_PORTD_IRQ_FILENAME GPIO_PROC_PORTD_FILENAME "irq"
-
-#define GPIO_PROC_PORTA_PULLUP_FILENAME GPIO_PROC_PORTA_FILENAME "pullup"
-#define GPIO_PROC_PORTB_PULLUP_FILENAME GPIO_PROC_PORTB_FILENAME "pullup"
-#define GPIO_PROC_PORTC_PULLUP_FILENAME GPIO_PROC_PORTC_FILENAME "pullup"
-#define GPIO_PROC_PORTD_PULLUP_FILENAME GPIO_PROC_PORTD_FILENAME "pullup"
-
-
-// By default, we use dynamic allocation of major numbers -> MAJOR = 0
-#define GPIO_MAJOR 0
-#define GPIO_MAX_MAJOR 254
-
-// IOCTL
-#define GPIORDDIRECTION _IOR(PP_IOCTL, 0xF0, int) //Read/write bitmask that determines input/output pins (1 means output, 0 input)
+/* IOCTL */
+#define GPIORDDIRECTION _IOR(PP_IOCTL, 0xF0, int) /* Read/write bitmask that determines input/output pins (1 means output, 0 input) */
#define GPIOWRDIRECTION _IOW(PP_IOCTL, 0xF1, int)
#define GPIORDDATA _IOR(PP_IOCTL, 0xF2, int)
#define GPIOWRDATA _IOW(PP_IOCTL, 0xF3, int)
-#define MAX_NUMBER_OF_PINS 32
-#define DRIVER_NAME "Armadeus GPIOs driver"
-#define DRIVER_VERSION "v2.0alpha"
-
-// Pretend we're PPDEV for IOCTL
+/* Pretend we're PPDEV for IOCTL */
#include <linux/ppdev.h>
-#endif // __CORE_GPIO_H__
+#endif /* __CORE_GPIO_H__ */
Modified: trunk/target/linux/modules/gpio/loadgpio.sh
===================================================================
--- trunk/target/linux/modules/gpio/loadgpio.sh 2009-03-11 14:04:26 UTC (rev 1143)
+++ trunk/target/linux/modules/gpio/loadgpio.sh 2009-03-11 14:20:34 UTC (rev 1144)
@@ -6,19 +6,13 @@
GPIO_DEV_DIR=/dev/gpio
-if [ -d "$1" ]; then
- GPIO_MODULES_DIR="$1"
-else
- KERNEL_VERSION=`uname -r`
- GPIO_MODULES_DIR="/lib/modules/$KERNEL_VERSION/extra/gpio/"
- echo "Using $GPIO_MODULES_DIR as default modules dir as no param was passed"
-fi
-
# Load GPIO main module
-#insmod $GPIO_MODULES_DIR/gpio.ko portB_init=0,0,0x00FFFF00,0,0,0,0,0,0xF00FFFFF,0,0,0,0,0,0,0x0FF00000 portD_init=0,0xFFFF0000,0xFFFFFFFF,0,0,0,0,0,0xFFFFFFFF,0,0,0,0,0,0,0xFFFFFC00
-insmod $GPIO_MODULES_DIR/gpio.ko
+#modprobe gpio portB_init=0,0,0x00FFFF00,0,0,0,0,0,0xF00FFFFF,0,0,0,0,0,0,0x0FF00000 portD_init=0,0xFFFF0000,0xFFFFFFFF,0,0,0,0,0,0xFFFFFFFF,0,0,0,0,0,0,0xFFFFFC00
+modprobe gpio
# Load PPDEV emulation module
-insmod $GPIO_MODULES_DIR/ppdev.ko port_mode=4
+if [ "$1" != "" ]; then
+ modprobe ppdev port_mode=4
+fi
GPIO_MAJOR=`cat /proc/devices | grep GPIO | cut -d " " -f 1`
PPDEV_MAJOR=`cat /proc/devices | grep ppdev | cut -d " " -f 1`
@@ -28,40 +22,61 @@
exit 1
fi
-mkdir -p /dev/parports
mkdir -p $GPIO_DEV_DIR
# For PPDEV
if [ "$PPDEV_MAJOR" != "" ]; then
+ mkdir -p /dev/parports
mknod /dev/parports/0 c $PPDEV_MAJOR 0
fi
+BOARD=`cat /etc/machine`
+
# /dev for "full" port access:
mknod $GPIO_DEV_DIR/portA c $GPIO_MAJOR 255
mknod $GPIO_DEV_DIR/portB c $GPIO_MAJOR 254
mknod $GPIO_DEV_DIR/portC c $GPIO_MAJOR 253
mknod $GPIO_DEV_DIR/portD c $GPIO_MAJOR 252
+if [ "$BOARD" == "APF27" ]; then
+mknod $GPIO_DEV_DIR/portE c $GPIO_MAJOR 251
+mknod $GPIO_DEV_DIR/portF c $GPIO_MAJOR 250
+fi
-# /dev for individual pin access:
-# PortA[0-31]
-for pin in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31; do
- minor=$pin
- mknod $GPIO_DEV_DIR/PA$pin c $GPIO_MAJOR $minor
-done
-# PortB[8-31]
-for pin in 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31; do
- minor=$((32+$pin))
- mknod $GPIO_DEV_DIR/PB$pin c $GPIO_MAJOR $minor
-done
-# PortC[3-17]
-for pin in 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17; do
- minor=$((64+$pin))
- mknod $GPIO_DEV_DIR/PC$pin c $GPIO_MAJOR $minor
-done
-# PortD[6-31]
-for pin in 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31; do
- minor=$((96+$pin))
- mknod $GPIO_DEV_DIR/PD$pin c $GPIO_MAJOR $minor
-done
+# params: $1=port, $2=pin start, $3=pin end, $4=minor start
+create_dev()
+{
+ for pin in `seq $2 $3`; do
+ minor=$(($4+$pin))
+ mknod $GPIO_DEV_DIR/P$1$pin c $GPIO_MAJOR $minor
+ done
+ echo -n "."
+}
+echo -n "Creating /dev nodes for individual pin access: "
+if [ "$BOARD" == "APF9328" ]; then
+ # PortA[0-31]
+ create_dev A 0 31 0
+ # PortB[8-31]
+ create_dev B 8 31 32
+ # PortC[3-17]
+ create_dev C 3 17 64
+ # PortD[6-31]
+ create_dev D 6 31 96
+ echo
+fi
+if [ "$BOARD" == "APF27" ]; then
+ # PortA[0-31]
+ create_dev A 0 31 0
+ # PortB[8-31]
+ create_dev B 8 31 32
+ # PortC[3-17]
+ create_dev C 3 17 64
+ # PortD[6-31]
+ create_dev D 6 31 96
+ # PortE[6-31]
+ create_dev E 6 31 128
+ # PortF[6-31]
+ create_dev F 6 31 160
+ echo
+fi
Property changes on: trunk/target/linux/modules/gpio/loadgpio.sh
___________________________________________________________________
Added: executable
+ ON
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Fa...@us...> - 2009-03-11 14:04:41
|
Revision: 1143
http://armadeus.svn.sourceforge.net/armadeus/?rev=1143&view=rev
Author: FabM
Date: 2009-03-11 14:04:26 +0000 (Wed, 11 Mar 2009)
Log Message:
-----------
[FIRMWARE] Make button_led design synchrone, and add a reset
Modified Paths:
--------------
trunk/firmware/leds/button_led/clock_divider.vhd
trunk/firmware/leds/button_led/debouncer.vhd
trunk/firmware/leds/button_led/flip_flop.vhd
trunk/firmware/leds/button_led/led_top.dia
trunk/firmware/leds/button_led/led_top.vhd
Added Paths:
-----------
trunk/firmware/leds/button_led/led_apf9328.ucf
trunk/firmware/leds/button_led/led_top_xc3s200.bit
trunk/firmware/leds/button_led/led_top_xc3s400.bit
trunk/firmware/leds/button_led/reset_gen.vhd
Removed Paths:
-------------
trunk/firmware/leds/button_led/led.ucf
trunk/firmware/leds/button_led/led_top_200k.bit
trunk/firmware/leds/button_led/led_top_400k.bit
Modified: trunk/firmware/leds/button_led/clock_divider.vhd
===================================================================
--- trunk/firmware/leds/button_led/clock_divider.vhd 2009-03-11 14:01:33 UTC (rev 1142)
+++ trunk/firmware/leds/button_led/clock_divider.vhd 2009-03-11 14:04:26 UTC (rev 1143)
@@ -1,26 +1,27 @@
----------------------------------------------------------------------------------
--- Company: Armadeus Project
--- Engineer: Benoit Canet
+-- company: armadeus project
+-- engineer: Benoît Canet
--
--- Create Date: 22:04:02 04/12/2007
--- Design Name:
--- Module Name: clock_divider - behavioral
--- Project Name:
--- Target Devices:
--- Tool versions:
--- Description:
+-- create date: 22:04:02 04/12/2007
+-- design name:
+-- module name: clock_divider - behavioral
+-- project name:
+-- target devices:
+-- tool versions:
+-- description:
--
--- Dependencies:
+-- dependencies:
--
--- Revision:
--- Revision 0.01 - File Created
--- Additional Comments:
+-- revision:
+-- revision 0.02 - add a reset (FabM)
+-- revision 0.01 - file created
+-- additional comments:
--
----------------------------------------------------------------------------------
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.STD_LOGIC_ARITH.ALL;
-use IEEE.STD_LOGIC_UNSIGNED.ALL;
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.std_logic_arith.all;
+use ieee.std_logic_unsigned.all;
entity clock_divider is
@@ -28,35 +29,34 @@
-- clock division ratio (must be a multiple of 2)
generic(ratio : integer := 2);
- port (clk_in : in STD_LOGIC;
- clk_out : out STD_LOGIC);
+ port (
+ reset : in std_logic ;
+ clk_in : in std_logic;
+ clk_out : out std_logic);
end clock_divider;
architecture behavioral of clock_divider is
- signal state : STD_LOGIC := '0';
+ signal state : std_logic := '0';
begin
- process (clk_in)
-
+ process (clk_in,reset)
variable count : integer range 0 to ratio;
-
begin
-
- if (clk_in'event) and (clk_in = '1') then
-
+ if reset = '1' then
+ count := 0;
+ clk_out <= '0';
+ elsif rising_edge(clk_in) then
-- count the number of clock change
count := count + 1;
-
-- if we waited long enough generate one clock change
if (count = ratio/2) then
state <= not state;
count := 0;
clk_out <= state;
end if;
-
end if;
end process;
Modified: trunk/firmware/leds/button_led/debouncer.vhd
===================================================================
--- trunk/firmware/leds/button_led/debouncer.vhd 2009-03-11 14:01:33 UTC (rev 1142)
+++ trunk/firmware/leds/button_led/debouncer.vhd 2009-03-11 14:04:26 UTC (rev 1143)
@@ -1,61 +1,66 @@
----------------------------------------------------------------------------------
--- Company: Armadeus Project
--- Engineer: Benoit Canet
+-- company: armadeus project
+-- engineer: Benoît Canet
--
--- Create Date: 21:48:05 04/12/2007
--- Design Name:
--- Module Name: debouncer - behavioral
--- Project Name:
--- Target Devices:
--- Tool versions:
--- Description:
+-- create date: 21:48:05 04/12/2007
+-- design name:
+-- module name: debouncer - behavioral
+-- project name:
+-- target devices:
+-- tool versions:
+-- description:
--
--- Dependencies:
+-- dependencies:
--
--- Revision:
--- Revision 0.01 - File Created
--- Additional Comments:
--- original code comes from Dennis Smith
--- http://homepage.mac.com/dgsmith1/HANDOUTS/EE452/debounce.vhd.txt
+-- revision:
+-- revision 0.02 - Make it synchrone with reset (FabM)
+-- revision 0.01 - file created
+-- additional comments:
+-- original code comes from dennis smith
+-- http://homepage.mac.com/dgsmith1/handouts/ee452/debounce.vhd.txt
----------------------------------------------------------------------------------
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.STD_LOGIC_ARITH.ALL;
-use IEEE.STD_LOGIC_UNSIGNED.ALL;
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.std_logic_arith.all;
+use ieee.std_logic_unsigned.all;
entity debouncer is
- port ( clk_100hz : in STD_LOGIC;
- button_in : in STD_LOGIC;
- button_debounced_out : out STD_LOGIC);
+ port ( clk : in std_logic;
+ reset : in std_logic ;
+ clk_ratio : in std_logic ;
+ button_in : in std_logic;
+ button_debounced_out : out std_logic);
end debouncer;
architecture behavioral of debouncer is
- signal shift_pb : STD_LOGIC_VECTOR(3 DOWNTO 0) := "0000";
- signal state : STD_LOGIC := '1';
+ signal shift_pb : std_logic_vector(3 downto 0) := "0000";
+ signal state : std_logic := '1';
begin
- process(clk_100hz)
+ process(clk,reset)
+ variable clk_ratio_old : std_logic := '0';
begin
- if (clk_100hz'event) and (clk_100hz = '1')
- then
- -- shift the register
- shift_pb(2 DOWNTO 0) <= shift_pb(3 DOWNTO 1);
- -- input the new sample in the register
- shift_pb(3) <= button_in;
- -- change output if needed
- case shift_pb is
- when "0000" =>
- state <= '0';
- when "1111" =>
- state <= '1';
- when others =>
- state <= state;
+ if reset = '1' then
+ state <= '0';
+ clk_ratio_old := '0';
+ elsif rising_edge(clk) then
+ if clk_ratio = '0' and clk_ratio /= clk_ratio_old then
+ -- shift the register
+ shift_pb(2 downto 0) <= shift_pb(3 downto 1);
+ -- input the new sample in the register
+ shift_pb(3) <= button_in;
+ -- change output if needed
+ case shift_pb is
+ when "0000" => state <= '0';
+ when "1111" => state <= '1';
+ when others => state <= state;
end case;
+ end if;
+ clk_ratio_old := clk_ratio;
end if;
-
end process;
button_debounced_out <= state;
Modified: trunk/firmware/leds/button_led/flip_flop.vhd
===================================================================
--- trunk/firmware/leds/button_led/flip_flop.vhd 2009-03-11 14:01:33 UTC (rev 1142)
+++ trunk/firmware/leds/button_led/flip_flop.vhd 2009-03-11 14:04:26 UTC (rev 1143)
@@ -1,32 +1,34 @@
----------------------------------------------------------------------------------
--- Company: Armadeus Project
--- Engineer: Benoit Canet
+-- company: armadeus project
+-- engineer: Benoît Canet
--
--- Create Date: 21:21:27 04/12/2007
--- Design Name:
--- Module Name: flip_flop - Behavioral
--- Project Name:
--- Target Devices:
--- Tool versions:
--- Description:
+-- create date: 21:21:27 04/12/2007
+-- design name:
+-- module name: flip_flop - behavioral
+-- project name:
+-- target devices:
+-- tool versions:
+-- description:
--
--- Dependencies:
+-- dependencies:
--
--- Revision:
--- Revision 0.01 - File Created
--- Additional Comments:
+-- revision:
+-- revision 0.02 - Synchronize with high speed clock (FabM)
+-- revision 0.01 - file created
+-- additional comments:
--
----------------------------------------------------------------------------------
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.STD_LOGIC_ARITH.ALL;
-use IEEE.STD_LOGIC_UNSIGNED.ALL;
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
-
entity flip_flop is
- port (clk_100hz : in STD_LOGIC;
- switch_in_n : in STD_LOGIC;
- led_out : out STD_LOGIC);
+ port (
+ clk : in std_logic;
+ reset : in std_logic ;
+ switch_in_n : in std_logic;
+ led_out : out std_logic
+ );
end flip_flop;
@@ -34,11 +36,15 @@
begin
- process(clk_100hz)
- variable state : STD_LOGIC := '0';
- variable latch : STD_LOGIC := '0';
+ led_output : process(clk,reset)
+ variable state : std_logic := '0';
+ variable latch : std_logic := '0';
begin
- if clk_100hz'event and (clk_100hz = '1') then
+ if reset = '1' then
+ led_out <= '0';
+ latch := '0';
+ state := '0';
+ elsif rising_edge(clk) then
-- switch_in_n is active when down
--( the switch is connected via a pullup)
if (switch_in_n = '0') and (latch /= switch_in_n) then
@@ -46,7 +52,6 @@
end if;
latch := switch_in_n;
led_out <= state;
-
end if;
end process;
Deleted: trunk/firmware/leds/button_led/led.ucf
===================================================================
--- trunk/firmware/leds/button_led/led.ucf 2009-03-11 14:01:33 UTC (rev 1142)
+++ trunk/firmware/leds/button_led/led.ucf 2009-03-11 14:04:26 UTC (rev 1143)
@@ -1,4 +0,0 @@
-# pinout
-NET "button" LOC = "P141" | IOSTANDARD = LVCMOS33 ;
-NET "clk" LOC = "P55" | IOSTANDARD = LVCMOS33 ;
-NET "led" LOC = "P116" | IOSTANDARD = LVCMOS33 ;
Copied: trunk/firmware/leds/button_led/led_apf9328.ucf (from rev 1116, trunk/firmware/leds/button_led/led.ucf)
===================================================================
--- trunk/firmware/leds/button_led/led_apf9328.ucf (rev 0)
+++ trunk/firmware/leds/button_led/led_apf9328.ucf 2009-03-11 14:04:26 UTC (rev 1143)
@@ -0,0 +1,4 @@
+# pinout
+NET "button" LOC = "P141" | IOSTANDARD = LVCMOS33 ;
+NET "clk" LOC = "P55" | IOSTANDARD = LVCMOS33 ;
+NET "led" LOC = "P116" | IOSTANDARD = LVCMOS33 ;
Modified: trunk/firmware/leds/button_led/led_top.dia
===================================================================
(Binary files differ)
Modified: trunk/firmware/leds/button_led/led_top.vhd
===================================================================
--- trunk/firmware/leds/button_led/led_top.vhd 2009-03-11 14:01:33 UTC (rev 1142)
+++ trunk/firmware/leds/button_led/led_top.vhd 2009-03-11 14:04:26 UTC (rev 1143)
@@ -1,83 +1,114 @@
----------------------------------------------------------------------------------
--- Company: Armadeus Project
--- Engineer: Benoit Canet
+-- company: armadeus project
+-- engineer: Benoît Canet
--
--- Create Date: 22:37:46 04/12/2007
--- Design Name:
--- Module Name: led_top - structural
--- Project Name:
--- Target Devices:
--- Tool versions:
--- Description:
+-- create date: 22:37:46 04/12/2007
+-- design name:
+-- module name: led_top - structural
+-- project name:
+-- target devices:
+-- tool versions:
+-- description:
--
--- Dependencies:
+-- dependencies:
--
--- Revision:
--- Revision 0.01 - File Created
--- Additional Comments:
+-- revision:
+-- revision 0.02 - Make it synchrone with reset (FabM)
+-- revision 0.01 - file created
+-- additional comments:
--
----------------------------------------------------------------------------------
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.STD_LOGIC_ARITH.ALL;
-use IEEE.STD_LOGIC_UNSIGNED.ALL;
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.std_logic_arith.all;
+use ieee.std_logic_unsigned.all;
entity led_top is
port (
- clk : in STD_LOGIC;
- button : in STD_LOGIC;
- led : out STD_LOGIC);
+ clk : in std_logic;
+ button : in std_logic;
+ led : out std_logic);
end led_top;
architecture structural of led_top is
- -- We declare the component we we'll use
+ -- we declare the component we we'll use
component clock_divider
generic (ratio: integer);
- port (clk_in : in STD_LOGIC;
- clk_out : out STD_LOGIC);
+ port (reset : in std_logic ;
+ clk_in : in std_logic;
+ clk_out : out std_logic);
end component;
-
- component debouncer
- port (clk_100hz : in STD_LOGIC;
- button_in : in STD_LOGIC;
- button_debounced_out : out STD_LOGIC);
- end component;
- component flip_flop
- port (clk_100hz : in STD_LOGIC;
- switch_in_n : in STD_LOGIC;
- led_out : out STD_LOGIC);
- end component;
+ component debouncer
+ port (clk : in std_logic ;
+ reset : in std_logic ;
+ clk_ratio : in std_logic;
+ button_in : in std_logic;
+ button_debounced_out : out std_logic);
+ end component;
+ component flip_flop
+ port (
+ clk : in std_logic;
+ reset : in std_logic ;
+ switch_in_n : in std_logic;
+ led_out : out std_logic
+ );
+ end component;
+
+ component reset_gen
+ generic (
+ invert_reset : std_logic := '0' -- 0 : not invert, 1 invert
+ );
+ port (
+ -- external signals
+ clk : in std_logic ;
+ --internal signals
+ reset : out std_logic
+ );
+ end component reset_gen;
+
-- internal signals
- signal clk_100hz : STD_LOGIC;
- signal button_debounced_n : STD_LOGIC;
-
- begin
-
- -- instantiate and connect the clock divider
- -- here we use a 96MHz/100Hz=960000 ratio
- i_clock_divider_identifier : clock_divider
- generic map(ratio => 960000)
- -- for simulation purpose use the following line
+ signal clk_ratio : std_logic;
+ signal reset : std_logic;
+ signal button_debounced_n : std_logic;
+
+begin
+
+ -- instantiate and connect the clock divider
+ -- here we use a 96mhz/100hz=960000 ratio
+ i_clock_divider_identifier : clock_divider
+ generic map(ratio => 960000)
+ -- for simulation purpose use the following line
-- instead of the previous
-- generic map(ratio => 2)
-
- port map (clk_in => clk,
- clk_out => clk_100hz);
- --instantiate and connect the debouncer
- i_debouncer_identifier : debouncer
- port map (button_in => button,
- clk_100hz => clk_100hz,
- button_debounced_out => button_debounced_n);
+ port map (reset => reset,
+ clk_in => clk,
+ clk_out => clk_ratio);
- --instantiate and connect the flip flop
- i_flip_flop_identifier : flip_flop
- port map (clk_100hz => clk_100hz,
- switch_in_n => button_debounced_n,
- led_out => led);
+ --instantiate and connect the debouncer
+ i_debouncer_identifier : debouncer
+ port map ( clk => clk,
+ reset => reset,
+ clk_ratio => clk_ratio,
+ button_in => button,
+ button_debounced_out => button_debounced_n);
+ --instantiate and connect the flip flop
+ i_flip_flop_identifier : flip_flop
+ port map (clk => clk,
+ reset => reset,
+ switch_in_n => button_debounced_n,
+ led_out => led);
+
+ i_reset_gen : reset_gen
+ generic map (invert_reset => '0')
+ port map (
+ clk => clk,
+ reset => reset
+ );
+
end structural;
Deleted: trunk/firmware/leds/button_led/led_top_200k.bit
===================================================================
(Binary files differ)
Deleted: trunk/firmware/leds/button_led/led_top_400k.bit
===================================================================
(Binary files differ)
Copied: trunk/firmware/leds/button_led/led_top_xc3s200.bit (from rev 1116, trunk/firmware/leds/button_led/led_top_200k.bit)
===================================================================
(Binary files differ)
Copied: trunk/firmware/leds/button_led/led_top_xc3s400.bit (from rev 1116, trunk/firmware/leds/button_led/led_top_400k.bit)
===================================================================
(Binary files differ)
Added: trunk/firmware/leds/button_led/reset_gen.vhd
===================================================================
--- trunk/firmware/leds/button_led/reset_gen.vhd (rev 0)
+++ trunk/firmware/leds/button_led/reset_gen.vhd 2009-03-11 14:04:26 UTC (rev 1143)
@@ -0,0 +1,56 @@
+---------------------------------------------------------------------------
+-- Company : ARMadeus Systems
+-- Author(s) : Fabien Marteau
+--
+-- Creation Date : 05/03/2008
+-- File : reset_gen.vhd
+--
+-- Abstract :
+--
+---------------------------------------------------------------------------
+library IEEE;
+use IEEE.STD_LOGIC_1164.ALL;
+use IEEE.numeric_std.all;
+
+---------------------------------------------------------------------------
+Entity reset_gen is
+---------------------------------------------------------------------------
+generic(
+ invert_reset : std_logic := '0' -- 0 : not invert, 1 invert
+);
+port
+(
+ -- external signals
+ clk : in std_logic ;
+ --internal signals
+ reset : out std_logic
+);
+end entity;
+
+
+---------------------------------------------------------------------------
+Architecture reset_gen_1 of reset_gen is
+---------------------------------------------------------------------------
+
+ signal dly: std_logic := '0';
+ signal rst: std_logic := '0';
+ signal reset_tmp : std_logic;
+
+begin
+
+ reset_tmp <= '0';
+ ----------------------------------------------------------------------------
+ -- RESET signal generator.
+ ----------------------------------------------------------------------------
+ process(clk)
+ begin
+ if(rising_edge(clk)) then
+ dly <= ( not(reset_tmp) and dly and not(rst) )
+ or ( not(reset_tmp) and not(dly) and rst );
+ rst <= ( not(reset_tmp) and not(dly) and not(rst) );
+ end if;
+ end process;
+ reset <= rst xor invert_reset ;
+
+end architecture reset_gen_1;
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <th...@us...> - 2009-03-11 14:01:42
|
Revision: 1142
http://armadeus.svn.sourceforge.net/armadeus/?rev=1142&view=rev
Author: thom25
Date: 2009-03-11 14:01:33 +0000 (Wed, 11 Mar 2009)
Log Message:
-----------
[LINUX] fix ticket 36 (fpgaloader does not compile even if selected)
Modified Paths:
--------------
trunk/target/linux/modules/fpga/dev_tools/loader/Makefile
Modified: trunk/target/linux/modules/fpga/dev_tools/loader/Makefile
===================================================================
--- trunk/target/linux/modules/fpga/dev_tools/loader/Makefile 2009-03-11 13:29:20 UTC (rev 1141)
+++ trunk/target/linux/modules/fpga/dev_tools/loader/Makefile 2009-03-11 14:01:33 UTC (rev 1142)
@@ -4,7 +4,7 @@
ifneq ($(KERNELRELEASE),)
-obj-$(CONFIG_ARMADEUS_FPGA_TOOL_DRIVER) += fpgaloader.o
+obj-$(CONFIG_ARMADEUS_FPGA_LOADER_DRIVER) += fpgaloader.o
ifneq ($(CONFIG_MACH_APF27),)
fpgaloader-objs := xilinx-fpga-loader.o fpga-loader.o
obj-y += apf27-fpga-loader.o
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gwe...@us...> - 2009-03-11 13:29:31
|
Revision: 1141
http://armadeus.svn.sourceforge.net/armadeus/?rev=1141&view=rev
Author: gwenhael
Date: 2009-03-11 13:29:20 +0000 (Wed, 11 Mar 2009)
Log Message:
-----------
[BUILDROOT]Xenomai patch corrects error on the patching packages/Config.in
Modified Paths:
--------------
trunk/patches/072-buildroot-xenomai-package.diff
Modified: trunk/patches/072-buildroot-xenomai-package.diff
===================================================================
--- trunk/patches/072-buildroot-xenomai-package.diff 2009-03-10 17:22:19 UTC (rev 1140)
+++ trunk/patches/072-buildroot-xenomai-package.diff 2009-03-11 13:29:20 UTC (rev 1141)
@@ -1,6 +1,6 @@
diff -ruN buildroot/package/Config.in buildroot.new/package/Config.in
---- buildroot.new/package/Config.in 2009-03-09 16:57:56.000000000 +0100
-+++ package/Config.in 2009-02-24 11:33:56.000000000 +0100
+--- buildroot/package/Config.in 2009-03-09 16:57:56.000000000 +0100
++++ buildroot.new/package/Config.in 2009-02-24 11:33:56.000000000 +0100
@@ -121,6 +121,8 @@
source "package/which/Config.in"
endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <th...@us...> - 2009-03-10 17:22:28
|
Revision: 1140
http://armadeus.svn.sourceforge.net/armadeus/?rev=1140&view=rev
Author: thom25
Date: 2009-03-10 17:22:19 +0000 (Tue, 10 Mar 2009)
Log Message:
-----------
[U-BOOT] fix bug FPGA autoload (ticket 34)
Modified Paths:
--------------
trunk/buildroot/target/u-boot/u-boot-1.3.4-310-apf27.patch
Modified: trunk/buildroot/target/u-boot/u-boot-1.3.4-310-apf27.patch
===================================================================
--- trunk/buildroot/target/u-boot/u-boot-1.3.4-310-apf27.patch 2009-03-10 14:32:12 UTC (rev 1139)
+++ trunk/buildroot/target/u-boot/u-boot-1.3.4-310-apf27.patch 2009-03-10 17:22:19 UTC (rev 1140)
@@ -39,7 +39,7 @@
+
+ blocksize = nand_info[0].erasesize;
+
-+ while (amount_loaded < CFG_ENV_SIZE && offset < end) {
++ while (offset < end) {
+ if (nand_block_isbad(&nand_info[0], offset)) {
+ offset += blocksize;
+ } else {
@@ -141,7 +141,7 @@
+ end = offset + simple_strtoul(s, NULL, 16);
+ }
+ if ((-1 != offset) && (offset != end)) {
-+ size = read_firmware (offset, end, firmware_buffer);
++ size = read_firmware (offset, end, firmware_buffer);
+ }
+ }
+ APF27_init_fpga (firmware_buffer, size);
@@ -200,7 +200,7 @@
+CONFIG_NAND_U_BOOT = y
--- ref/u-boot-1.3.4/board/armadeus/apf27/fpga.c 1970-01-01 01:00:00.000000000 +0100
+++ u-boot-1.3.4/board/armadeus/apf27/fpga.c 2008-12-29 16:27:49.000000000 +0100
-@@ -0,0 +1,253 @@
+@@ -0,0 +1,255 @@
+ /*
+ * (C) Copyright 2002-2008
+ * Eric Jarrige <eri...@ar...>
@@ -449,6 +449,8 @@
+ lout = 1;
+ printf("Firmware download failed!\n");
+ }
++ else
++ printf("Firmware successfully programmed\n");
+ }
+ return lout;
+ }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-03-10 14:32:33
|
Revision: 1139
http://armadeus.svn.sourceforge.net/armadeus/?rev=1139&view=rev
Author: artemys
Date: 2009-03-10 14:32:12 +0000 (Tue, 10 Mar 2009)
Log Message:
-----------
[LINUX] Cleanup in gpio driver: kernel friendly indentation, removing of unused code
Modified Paths:
--------------
trunk/target/linux/modules/gpio/Kconfig
trunk/target/linux/modules/gpio/core.c
trunk/target/linux/modules/gpio/ppdevemu.c
Removed Paths:
-------------
trunk/target/linux/modules/gpio/ppdevemu.h
Modified: trunk/target/linux/modules/gpio/Kconfig
===================================================================
--- trunk/target/linux/modules/gpio/Kconfig 2009-03-10 12:50:55 UTC (rev 1138)
+++ trunk/target/linux/modules/gpio/Kconfig 2009-03-10 14:32:12 UTC (rev 1139)
@@ -8,9 +8,9 @@
---help---
config ARMADEUS_PPDEV_DRIVER
- tristate "Armadeus Parallel Port driver"
+ tristate "Armadeus Parallel Port emulation driver (with LCD port)"
default n
- depends on ARMADEUS_GPIO_DRIVER
+ depends on ARMADEUS_GPIO_DRIVER && MACH_APF9328
---help---
This driver allows you to emulate a parallel port interface with GPIO.
- Activate it if you want for example connect a LCD with a // port interface.
\ No newline at end of file
+ Activate it if you want for example connect a LCD with a // port interface.
Modified: trunk/target/linux/modules/gpio/core.c
===================================================================
--- trunk/target/linux/modules/gpio/core.c 2009-03-10 12:50:55 UTC (rev 1138)
+++ trunk/target/linux/modules/gpio/core.c 2009-03-10 14:32:12 UTC (rev 1139)
@@ -56,7 +56,7 @@
#define FULL_MINOR_TO_PORT(x) (MAX_MINOR - x)
-// Parameters order:
+/* Parameters order: */
enum {
DDIR_I = 0,
OCR1_I,
@@ -76,7 +76,7 @@
PUEN_I,
};
-// Global variables
+/* Global variables */
struct gpio_operations *driver_ops;
static int gpio_major = GPIO_MAJOR;
@@ -97,7 +97,7 @@
int type;
};
-// Module parameters
+/* Module parameters */
#define NB_CONFIG_REGS 16
static int portA_init[NB_CONFIG_REGS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
static int portA_init_nb = 0;
@@ -134,28 +134,29 @@
int id;
struct class_device *gpio_dev;
struct cdev char_dev;
-// struct config_item item; TBDJUJU: Use configfs filesystem !
+ /* struct config_item item; TBDJUJU: Use configfs filesystem ! */
};
static unsigned int shadows_irq[NB_PORTS] = { 0, 0, 0, 0 };
-// Static functions
+/* Static functions */
+
static void __exit armadeus_gpio_cleanup(void);
static int toString(unsigned long value, char* buffer, int number_of_bits)
{
- static int i;
-
- /* convert it into a string */
- for(i=number_of_bits;i>0;i--){
- buffer[number_of_bits-i]=test_bit(i-1,&value)?'1':'0';
- }
-
- buffer[number_of_bits] = '\n';
- buffer[number_of_bits+1] = 0;
-
- return number_of_bits+1;
+ static int i;
+
+ /* convert it into a string */
+ for (i=number_of_bits;i>0;i--) {
+ buffer[number_of_bits-i]=test_bit(i-1,&value)?'1':'0';
+ }
+
+ buffer[number_of_bits] = '\n';
+ buffer[number_of_bits+1] = 0;
+
+ return number_of_bits+1;
}
/* Convert binary string ("010011") to int. Don't care of non '0' / '1' chars */
@@ -166,8 +167,7 @@
ret_val = 0;
/* Create WORD to write from the string */
- for( i=0, j=1; j<=number_of_bits; i++)
- {
+ for ( i=0, j=1; j<=number_of_bits; i++) {
//printk("%x j=%d i=%d\n", buffer[i], j, i);
if (buffer[i] == '\0') break; /* EOC */
@@ -180,162 +180,91 @@
}
}
- return(ret_val);
+ return ret_val;
}
-//------------------------------------------------
-//
-// Low level functions
-//
+/*
+ * Low level functions
+ */
#define DEFAULT_VALUE 0x12345678
-// These masks are for restricting user access to configuration of some criticals GPIO pins used by Armadeus and not configurable
+/* These masks are for restricting user access to configuration of some
+ criticals GPIO pins used by Armadeus and not configurable */
static unsigned long MASK[]= { 0x0003FFFE, 0xF00FFF00, 0x0003E1F8, 0xFFFFFFFF };
#define PORT_A_MASK 0x0003FFFE
#define PORT_B_MASK 0xF00FFF00
#define PORT_C_MASK 0x0003E1F8
#define PORT_D_MASK 0xFFFFFFFF
-static void initializePortA( void )
+static void initialize_port(int port, int* init_params)
{
- unsigned long lTemp;
-
- // Initialize PORTA with module parameters
- if( portA_init[DR_I] != 0 ) { DR(PORT_A) = portA_init[DR_I]; }
- if( portA_init[SSR_I] != 0 ) { SSR(PORT_A) = portA_init[SSR_I]; }
- if( portA_init[OCR1_I] != 0 ) { OCR1(PORT_A) = portA_init[OCR1_I]; } /*else { default value are already set by iMX !!*/
- if( portA_init[OCR2_I] != 0 ) { OCR2(PORT_A) = portA_init[OCR2_I]; }
- if( portA_init[ICONFA1_I] != 0 ) { ICONFA1(PORT_A) = portA_init[ICONFA1_I]; }
- if( portA_init[ICONFA2_I] != 0 ) { ICONFA2(PORT_A) = portA_init[ICONFA2_I]; }
- if( portA_init[ICONFB1_I] != 0 ) { ICONFB1(PORT_A) = portA_init[ICONFB1_I]; }
- if( portA_init[ICONFB2_I] != 0 ) { ICONFB2(PORT_A) = portA_init[ICONFB2_I]; }
- if( portA_init[DDIR_I] != 0 ) { DDIR(PORT_A) = portA_init[DDIR_I]; }
- if( portA_init[SWR_I] != 0 ) { SWR(PORT_A) = portA_init[SWR_I]; }
- if( portA_init[GPR_I] != 0 ) { lTemp = GPR(PORT_A) & (~MASK[PORT_A]); GPR(PORT_A) = lTemp | (portA_init[GPR_I] & MASK[PORT_A]); }
- if( portA_init[GIUS_I] != 0 ) { lTemp = GIUS(PORT_A) & (~MASK[PORT_A]); GIUS(PORT_A) = lTemp | (portA_init[GIUS_I] & MASK[PORT_A]); }
- if( portA_init[PUEN_I] != 0 ) { lTemp = PUEN(PORT_A) & (~MASK[PORT_A]); PUEN(PORT_A) = lTemp | (portA_init[PUEN_I] & MASK[PORT_A]); }
- if( portA_init[ICR1_I] != 0 ) { ICR1(PORT_A) = portA_init[ICR1_I]; }
- if( portA_init[ICR2_I] != 0 ) { ICR2(PORT_A) = portA_init[ICR2_I]; }
- if( portA_init[IMR_I] != 0 ) { IMR(PORT_A) = portA_init[IMR_I]; }
+ unsigned long lTemp;
+
+ /* Initialize PORT with module parameters */
+ if (init_params[DR_I]) { DR(port) = init_params[DR_I]; }
+ if (init_params[SSR_I]) { SSR(port) = init_params[SSR_I]; }
+ if (init_params[OCR1_I]) { OCR1(port) = init_params[OCR1_I]; }
+ /*else { default value are already set by iMX !!*/
+ if (init_params[OCR2_I]) { OCR2(port) = init_params[OCR2_I]; }
+ if (init_params[ICONFA1_I]) { ICONFA1(port) = init_params[ICONFA1_I]; }
+ if (init_params[ICONFA2_I]) { ICONFA2(port) = init_params[ICONFA2_I]; }
+ if (init_params[ICONFB1_I]) { ICONFB1(port) = init_params[ICONFB1_I]; }
+ if (init_params[ICONFB2_I]) { ICONFB2(port) = init_params[ICONFB2_I]; }
+ if (init_params[DDIR_I]) { DDIR(port) = init_params[DDIR_I]; }
+ if (init_params[SWR_I]) { SWR(port) = init_params[SWR_I]; }
+ if (init_params[GPR_I]) { lTemp = GPR(port) & (~MASK[port]); GPR(port) = lTemp | (init_params[GPR_I] & MASK[port]); }
+ if (init_params[GIUS_I]) { lTemp = GIUS(port) & (~MASK[port]); GIUS(port) = lTemp | (init_params[GIUS_I] & MASK[port]); }
+ if (init_params[PUEN_I]) { lTemp = PUEN(port) & (~MASK[port]); PUEN(port) = lTemp | (init_params[PUEN_I] & MASK[port]); }
+ if (init_params[ICR1_I]) { ICR1(port) = init_params[ICR1_I]; }
+ if (init_params[ICR2_I]) { ICR2(port) = init_params[ICR2_I]; }
+ if (init_params[IMR_I]) { IMR(port) = init_params[IMR_I]; }
}
-static void initializePortB( void )
+static void initialize_all_ports( void )
{
- unsigned long lTemp;
-
- // Initialize PORTB with module parameters
- if( portB_init[DR_I] != 0 ) { DR(PORT_B) = portB_init[DR_I]; }
- if( portB_init[SSR_I] != 0 ) { SSR(PORT_B) = portB_init[SSR_I]; }
- if( portB_init[OCR1_I] != 0 ) { OCR1(PORT_B) = portB_init[OCR1_I]; } /*else { default value are already set by iMX !!*/
- if( portB_init[OCR2_I] != 0 ) { OCR2(PORT_B) = portB_init[OCR2_I]; }
- if( portB_init[ICONFA1_I] != 0 ) { ICONFA1(PORT_B) = portB_init[ICONFA1_I]; }
- if( portB_init[ICONFA2_I] != 0 ) { ICONFA2(PORT_B) = portB_init[ICONFA2_I]; }
- if( portB_init[ICONFB1_I] != 0 ) { ICONFB1(PORT_B) = portB_init[ICONFB1_I]; }
- if( portB_init[ICONFB2_I] != 0 ) { ICONFB2(PORT_B) = portB_init[ICONFB2_I]; }
- if( portB_init[DDIR_I] != 0 ) { DDIR(PORT_B) = portB_init[DDIR_I]; }
- if( portB_init[SWR_I] != 0 ) { SWR(PORT_B) = portB_init[SWR_I]; }
- if( portB_init[GPR_I] != 0 ) { lTemp = GPR(PORT_B) & (~MASK[PORT_B]); GPR(PORT_B) = lTemp | (portB_init[GPR_I] & MASK[PORT_B]); }
- if( portB_init[GIUS_I] != 0 ) { lTemp = GIUS(PORT_B) & (~MASK[PORT_B]); GIUS(PORT_B) = lTemp | (portB_init[GIUS_I] & MASK[PORT_B]); }
- if( portB_init[PUEN_I] != 0 ) { lTemp = PUEN(PORT_B) & (~MASK[PORT_B]); PUEN(PORT_B) = lTemp | (portB_init[PUEN_I] & MASK[PORT_B]); }
- if( portB_init[ICR1_I] != 0 ) { ICR1(PORT_B) = portB_init[ICR1_I]; }
- if( portB_init[ICR2_I] != 0 ) { ICR2(PORT_B) = portB_init[ICR2_I]; }
- if( portB_init[IMR_I] != 0 ) { IMR(PORT_B) = portB_init[IMR_I]; }
+ initialize_port(PORT_A, portA_init);
+ initialize_port(PORT_B, portB_init);
+ initialize_port(PORT_C, portC_init);
+ initialize_port(PORT_D, portD_init);
}
-static void initializePortC( void )
-{
- unsigned long lTemp;
- // Initialize PORTC with module parameters
- if( portC_init[DR_I] != 0 ) { DR(PORT_C) = portC_init[DR_I]; }
- if( portC_init[SSR_I] != 0 ) { SSR(PORT_C) = portC_init[SSR_I]; }
- if( portC_init[OCR1_I] != 0 ) { OCR1(PORT_C) = portC_init[OCR1_I]; } /*else { default value are already set by iMX !!*/
- if( portC_init[OCR2_I] != 0 ) { OCR2(PORT_C) = portC_init[OCR2_I]; }
- if( portC_init[ICONFA1_I] != 0 ) { ICONFA1(PORT_C) = portC_init[ICONFA1_I]; }
- if( portC_init[ICONFA2_I] != 0 ) { ICONFA2(PORT_C) = portC_init[ICONFA2_I]; }
- if( portC_init[ICONFB1_I] != 0 ) { ICONFB1(PORT_C) = portC_init[ICONFB1_I]; }
- if( portC_init[ICONFB2_I] != 0 ) { ICONFB2(PORT_C) = portC_init[ICONFB2_I]; }
- if( portC_init[DDIR_I] != 0 ) { DDIR(PORT_C) = portC_init[DDIR_I]; }
- if( portC_init[SWR_I] != 0 ) { SWR(PORT_C) = portC_init[SWR_I]; }
- if( portC_init[GPR_I] != 0 ) { lTemp = GPR(PORT_C) & (~MASK[PORT_C]); GPR(PORT_C) = lTemp | (portC_init[GPR_I] & MASK[PORT_C]); }
- if( portC_init[GIUS_I] != 0 ) { lTemp = GIUS(PORT_C) & (~MASK[PORT_C]); GIUS(PORT_C) = lTemp | (portC_init[GIUS_I] & MASK[PORT_C]); }
- if( portC_init[PUEN_I] != 0 ) { lTemp = PUEN(PORT_C) & (~MASK[PORT_C]); PUEN(PORT_C) = lTemp | (portC_init[PUEN_I] & MASK[PORT_C]); }
- if( portC_init[ICR1_I] != 0 ) { ICR1(PORT_C) = portC_init[ICR1_I]; }
- if( portC_init[ICR2_I] != 0 ) { ICR2(PORT_C) = portC_init[ICR2_I]; }
- if( portC_init[IMR_I] != 0 ) { IMR(PORT_C) = portC_init[IMR_I]; }
-}
+/* TBDJUJU: replace the following functions with imx_gpio_xxx one !! */
-static void initializePortD( void )
+static void writeOnPort( unsigned int aPort, unsigned int aValue )
{
- unsigned long lTemp;
-
- // Initialize PORTD with module parameters
- if( portD_init[DR_I] != 0 ) { DR(PORT_D) = portD_init[DR_I]; }
- if( portD_init[SSR_I] != 0 ) { SSR(PORT_D) = portD_init[SSR_I]; }
- if( portD_init[OCR1_I] != 0 ) { OCR1(PORT_D) = portD_init[OCR1_I]; } /*else { default value are already set by iMX !!*/
- if( portD_init[OCR2_I] != 0 ) { OCR2(PORT_D) = portD_init[OCR2_I]; }
- if( portD_init[ICONFA1_I] != 0 ) { ICONFA1(PORT_D) = portD_init[ICONFA1_I]; }
- if( portD_init[ICONFA2_I] != 0 ) { ICONFA2(PORT_D) = portD_init[ICONFA2_I]; }
- if( portD_init[ICONFB1_I] != 0 ) { ICONFB1(PORT_D) = portD_init[ICONFB1_I]; }
- if( portD_init[ICONFB2_I] != 0 ) { ICONFB2(PORT_D) = portD_init[ICONFB2_I]; }
- if( portD_init[DDIR_I] != 0 ) { DDIR(PORT_D) = portD_init[DDIR_I]; }
- if( portD_init[SWR_I] != 0 ) { SWR(PORT_D) = portD_init[SWR_I]; }
- if( portD_init[GPR_I] != 0 ) { lTemp = GPR(PORT_D) & (~MASK[PORT_D]); GPR(PORT_D) = lTemp | (portD_init[GPR_I] & MASK[PORT_D]); }
- if( portD_init[GIUS_I] != 0 ) { lTemp = GIUS(PORT_D) & (~MASK[PORT_D]); GIUS(PORT_D) = lTemp | (portD_init[GIUS_I] & MASK[PORT_D]); }
- if( portD_init[PUEN_I] != 0 ) { lTemp = PUEN(PORT_D) & (~MASK[PORT_D]); PUEN(PORT_D) = lTemp | (portD_init[PUEN_I] & MASK[PORT_D]); }
- if( portD_init[ICR1_I] != 0 ) { ICR1(PORT_D) = portD_init[ICR1_I]; }
- if( portD_init[ICR2_I] != 0 ) { ICR2(PORT_D) = portD_init[ICR2_I]; }
- if( portD_init[IMR_I] != 0 ) { IMR(PORT_D) = portD_init[IMR_I]; }
+ DR(aPort) = (aValue & MASK[aPort]);
}
-static void initializePorts( void )
+static unsigned int readFromPort( unsigned int aPort )
{
- initializePortA();
- initializePortB();
- initializePortC();
- initializePortD();
-}
+ unsigned int port_value = 0;
+ /* Get the status of the gpio ports */
+ port_value = (SSR(aPort));
-// TBDJUJU: replace the following functions with imx_gpio_xxx one !!
-
-static void writeOnPort( unsigned int aPort, unsigned int aValue )
-{
- //
- DR(aPort) = (aValue & MASK[aPort]);
+ return( port_value );
}
-static unsigned int readFromPort( unsigned int aPort )
-{
- unsigned int port_value = 0;
-
- // Get the status of the gpio ports
- port_value = (SSR(aPort));
-
- return( port_value );
-}
-
static void setPortDir( unsigned int aPort, unsigned int aDirMask )
{
- DDIR(aPort) = (aDirMask & 0xffffffff);
+ DDIR(aPort) = (aDirMask & 0xffffffff);
}
static unsigned int getPortDir( unsigned int aPort )
{
- unsigned int port_value = 0;
-
- // Get the status of the gpio direction registers TBDNICO
- port_value = (DDIR(aPort));
-
- return( port_value );
+ unsigned int port_value = 0;
+
+ /* Get the status of the gpio direction registers TBDNICO */
+ port_value = (DDIR(aPort));
+
+ return( port_value );
}
char* port_name[NB_PORTS] = { "PortA", "PortB", "PortC", "PortD" };
char* port_setting_name[4] = { "Value", "Direction", "Pull-up", "Interrupt" };
-//------------------------------------------------
-//
-// Handles write() done on /dev/gpioxx
-//
+
+/* Handles write() done on /dev/gpioxx */
static ssize_t armadeus_gpio_dev_write(struct file *file, const char *data, size_t count, loff_t *offset)
{
unsigned int minor=0;
@@ -367,27 +296,27 @@
ret = count;
out:
- up(&gpio_sema);
- return ret;
+ up(&gpio_sema);
+ return ret;
}
-//
-// Handles read() done on /dev/gpioxx
-//
-static ssize_t armadeus_gpio_dev_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+/* Handles read() done on /dev/gpioxx */
+static ssize_t armadeus_gpio_dev_read(struct file *file, char *buf,
+ size_t count, loff_t *ppos)
{
- unsigned minor = MINOR(file->f_dentry->d_inode->i_rdev);
- u32 value=0;
- ssize_t ret = 0;
- u32 port_status;
+ unsigned minor = MINOR(file->f_dentry->d_inode->i_rdev);
+ u32 value=0;
+ ssize_t ret = 0;
+ u32 port_status;
struct gpio_item *gpio = file->private_data;
- if (count == 0)
- return count;
+ if (count == 0)
+ return count;
spin_lock_irq(&gpio->lock);
- pr_debug("- %s %d byte(s) on minor %d -> %s pin %d\n", __FUNCTION__, count, minor, port_name[gpio->port], gpio->number);
+ pr_debug("- %s %d byte(s) on minor %d -> %s pin %d\n", __FUNCTION__,
+ count, minor, port_name[gpio->port], gpio->number);
while (!gpio->changed) {
spin_unlock_irq(&gpio->lock);
@@ -402,7 +331,7 @@
}
gpio->changed = 0;
- if( gpio->nb_pins != 1) {
+ if (gpio->nb_pins != 1) {
value = readFromPort( gpio->port );
pr_debug("Full port read: 0x%x\n", value);
} else {
@@ -410,19 +339,19 @@
pr_debug("Single pin read: %d\n", value);
}
- value = readFromPort( minor );
- port_status = (char)(value & 0xFF);
+ value = readFromPort( minor );
+ port_status = (char)(value & 0xFF);
count = min( count, (size_t)sizeof(u32) );
- if ( copy_to_user(buf, &value, count) ) {
- ret = -EFAULT;
- goto out;
- }
- ret = count;
+ if (copy_to_user(buf, &value, count)) {
+ ret = -EFAULT;
+ goto out;
+ }
+ ret = count;
out:
- spin_unlock_irq(&gpio->lock);
- return ret;
+ spin_unlock_irq(&gpio->lock);
+ return ret;
}
@@ -448,12 +377,10 @@
return IRQ_HANDLED;
}
-//
-// Handles open() done on /dev/gpioxx
-//
+/* Handles open() done on /dev/gpioxx */
static int armadeus_gpio_dev_open(struct inode *inode, struct file *file)
{
- unsigned minor = MINOR(inode->i_rdev);
+ unsigned minor = MINOR(inode->i_rdev);
unsigned int major = MAJOR(inode->i_rdev);
unsigned int irq;
int ret = 0;
@@ -468,7 +395,7 @@
spin_lock_init(&gpio->lock);
init_waitqueue_head(&gpio->change_wq);
- switch(minor)
+ switch (minor)
{
/* Write all port pins in one time */
case FULL_PORTA_MINOR:
@@ -507,7 +434,7 @@
ret = request_irq( irq, armadeus_gpio_interrupt, 0, "gpio", gpio );
if( ret )
goto err_irq;
-// set_irq_type( irq, IRQF_TRIGGER_FALLING ); TDBJUJU
+ /* set_irq_type( irq, IRQF_TRIGGER_FALLING ); TDBJUJU */
}
success:
@@ -524,9 +451,7 @@
return ret;
}
-//
-// Handles close() done on /dev/gpioxx
-//
+/* Handles close() done on /dev/gpioxx */
static int armadeus_gpio_dev_release(struct inode *inode, struct file *file)
{
unsigned minor = MINOR(inode->i_rdev);
@@ -546,91 +471,93 @@
return 0;
}
-//------------------------------------------------
-// Handling of IOCTL calls
-//
-int armadeus_gpio_dev_ioctl( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg )
+/* Handling of IOCTL calls */
+int armadeus_gpio_dev_ioctl( struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg )
{
- int err = 0; int ret = 0;
- int value=0;
- unsigned int minor;
-
- printk( DRIVER_NAME " ## IOCTL received: (0x%x) ##\n", cmd );
-
- // Extract the type and number bitfields, and don't decode wrong cmds: return ENOTTY (inappropriate ioctl) before access_ok()
- if (_IOC_TYPE(cmd) != PP_IOCTL) return -ENOTTY;
+ int err = 0; int ret = 0;
+ int value=0;
+ unsigned int minor;
- // The direction is a bitmask, and VERIFY_WRITE catches R/W transfers. `Type' is user-oriented, while access_ok is kernel-oriented,
- // so the concept of "read" and "write" is reversed
- if (_IOC_DIR(cmd) & _IOC_READ)
- err = !access_ok(VERIFY_WRITE, (void *)arg, _IOC_SIZE(cmd));
- else if (_IOC_DIR(cmd) & _IOC_WRITE)
- err = !access_ok(VERIFY_READ, (void *)arg, _IOC_SIZE(cmd));
+ printk( DRIVER_NAME " ## IOCTL received: (0x%x) ##\n", cmd );
- if (err) return -EFAULT;
+ /* Extract the type and number bitfields, and don't decode wrong cmds:
+ return ENOTTY (inappropriate ioctl) before access_ok() */
+ if (_IOC_TYPE(cmd) != PP_IOCTL) return -ENOTTY;
+
+ /* The direction is a bitmask, and VERIFY_WRITE catches R/W transfers.
+ `Type' is user-oriented, while access_ok is kernel-oriented,
+ so the concept of "read" and "write" is reversed */
+ if (_IOC_DIR(cmd) & _IOC_READ)
+ err = !access_ok(VERIFY_WRITE, (void *)arg, _IOC_SIZE(cmd));
+ else if (_IOC_DIR(cmd) & _IOC_WRITE)
+ err = !access_ok(VERIFY_READ, (void *)arg, _IOC_SIZE(cmd));
- // Obtain exclusive access
- if (down_interruptible(&gpio_sema))
- return -ERESTARTSYS;
- // Extract and test minor
- minor = MINOR(inode->i_rdev);
- if( minor < FULL_PORTD_MINOR ) {
- printk("Minor outside range: %d !\n", minor);
- return -EFAULT;
- }
-
- switch(cmd)
- {
- case GPIORDDIRECTION:
- value = getPortDir( minor );
- ret = __put_user(value, (unsigned int *)arg);
- break;
+ if (err) return -EFAULT;
- case GPIOWRDIRECTION:
- ret = __get_user(value, (unsigned int *)arg);
+ /* Obtain exclusive access */
+ if (down_interruptible(&gpio_sema))
+ return -ERESTARTSYS;
+ /* Extract and test minor */
+ minor = MINOR(inode->i_rdev);
+ if (minor < FULL_PORTD_MINOR) {
+ printk("Minor outside range: %d !\n", minor);
+ return -EFAULT;
+ }
- if( ret==0 ) {
- setPortDir( minor, value );
- }
- break;
-
- case GPIORDDATA:
- value = readFromPort( minor );
- ret = __put_user(value, (unsigned int *)arg);
- break;
-
- case GPIOWRDATA:
- ret = __get_user(value, (unsigned int *)arg);
- if( ret == 0 ) {
- writeOnPort( minor, value );
- }
- break;
-
- default:
- return -ENOTTY;
- break;
- }
- // Release exclusive access
- up(&gpio_sema);
-
- return ret;
+ switch(cmd)
+ {
+ case GPIORDDIRECTION:
+ value = getPortDir( minor );
+ ret = __put_user(value, (unsigned int *)arg);
+ break;
+
+ case GPIOWRDIRECTION:
+ ret = __get_user(value, (unsigned int *)arg);
+
+ if (ret==0) {
+ setPortDir( minor, value );
+ }
+ break;
+
+ case GPIORDDATA:
+ value = readFromPort( minor );
+ ret = __put_user(value, (unsigned int *)arg);
+ break;
+
+ case GPIOWRDATA:
+ ret = __get_user(value, (unsigned int *)arg);
+ if (ret == 0) {
+ writeOnPort( minor, value );
+ }
+ break;
+
+ default:
+ return -ENOTTY;
+ break;
+ }
+ /* Release exclusive access */
+ up(&gpio_sema);
+
+ return ret;
}
-//------------------------------------------------
-// PROC file functions
-//
+/*
+ * PROC file functions
+ */
-static int armadeus_gpio_proc_read( char *buffer, char **start, off_t offset, int buffer_length, int *eof, __attribute__ ((unused)) void *data )
+static int armadeus_gpio_proc_read(char *buffer, char **start, off_t offset,
+ int buffer_length, int *eof, __attribute__ ((unused)) void *data)
{
- int len = 0; /* The number of bytes actually used */
- unsigned int port_status = 0x66;
- unsigned int port_ID = 0;
+ int len = 0; /* The number of bytes actually used */
+ unsigned int port_status = 0x66;
+ unsigned int port_ID = 0;
struct gpio_settings *settings = (struct gpio_settings *) data;
- if( settings != NULL ) {
- port_ID = settings->port;
- }
+ if (settings != NULL) {
+ port_ID = settings->port;
+ }
/* We give all of our information in one go, so if the user asks us if we
have more information the answer should always be no. This is important
@@ -638,11 +565,11 @@
issue the read system call until the kernel replies that it has no more
information, or until its buffer is filled
*/
- if( offset > 0 || buffer_length < (number_of_pins[port_ID]+2) )
- return 0;
+ if (offset > 0 || buffer_length < (number_of_pins[port_ID]+2))
+ return 0;
- if (down_interruptible(&gpio_sema))
- return -ERESTARTSYS;
+ if (down_interruptible(&gpio_sema))
+ return -ERESTARTSYS;
switch( settings->type )
{
@@ -651,7 +578,7 @@
break;
case DIRECTION:
- // Get the status of the gpio direction registers TBDNICO
+ /* Get the status of the gpio direction registers TBDNICO */
printk("direction\n");
port_status = getPortDir(port_ID);
break;
@@ -674,11 +601,11 @@
len = toString(port_status, buffer, number_of_pins[port_ID]);
printk("0x%08x\n", port_status);
- *eof = 1;
- up(&gpio_sema);
-
- // Return the length
- return len;
+ *eof = 1;
+ up(&gpio_sema);
+
+ /* Return the length */
+ return len;
}
static char new_gpio_state[MAX_NUMBER_OF_PINS*2];
@@ -690,36 +617,36 @@
unsigned int port_ID = 0;
struct gpio_settings *settings = (struct gpio_settings *) data;
- if( settings != NULL ) {
+ if (settings != NULL) {
port_ID = settings->port;
}
- /* Do some checks on parameters */
- if( count <= 0 ) {
- printk("Empty string transmitted !\n");
- return 0;
- }
+ /* Do some checks on parameters */
+ if (count <= 0) {
+ printk("Empty string transmitted !\n");
+ return 0;
+ }
if (count > (MAX_NUMBER_OF_PINS + 1))
printk("GPIO port registers are only 32bits !\n");
- if( count > (sizeof(new_gpio_state)) ) {
+ if (count > (sizeof(new_gpio_state))) {
len = sizeof(new_gpio_state);
} else {
len = count;
}
- /* Get exclusive access to port */
- if( down_interruptible(&gpio_sema) )
- return -ERESTARTSYS;
+ /* Get exclusive access to port */
+ if( down_interruptible(&gpio_sema) )
+ return -ERESTARTSYS;
- /* Get datas to write from user space */
- if (copy_from_user(new_gpio_state, buf, len)) {
- up(&gpio_sema);
- return -EFAULT;
- }
+ /* Get datas to write from user space */
+ if (copy_from_user(new_gpio_state, buf, len)) {
+ up(&gpio_sema);
+ return -EFAULT;
+ }
if( strlen(new_gpio_state) > 0 )
{
- // Convert it from String to Int
+ /* Convert it from String to Int */
gpio_state = fromString( new_gpio_state, number_of_pins[port_ID] );
switch( settings->type )
@@ -748,11 +675,14 @@
break;
}
- printk("/proc wrote 0x%x on %s %s register\n", gpio_state, port_name[port_ID], port_setting_name[settings->type]);
+ printk("/proc wrote 0x%x on %s %s register\n", gpio_state,
+ port_name[port_ID], port_setting_name[settings->type]);
}
- up(&gpio_sema);
- return count; /* Makes as if we take all the data send even if we can't handle more than register size */
+ up(&gpio_sema);
+ /* Makes as if we take all the data sent even if we can't handle more
+ than register size */
+ return count;
}
@@ -768,10 +698,10 @@
{
int i;
- for( i=0; i<4; i++ )
+ for (i = 0; i < 4; i++)
{
config[i].entry = create_proc_entry( config[i].name, S_IWUSR |S_IRUSR | S_IRGRP | S_IROTH, NULL);
- if( config[i].entry == NULL ) {
+ if (config[i].entry == NULL) {
printk(KERN_ERR DRIVER_NAME ": Couldn't register %s. Terminating.\n", config[i].name);
return -ENOMEM;
}
@@ -789,17 +719,17 @@
/*
* Create /proc entries for direct access (with echo/cat) to GPIOs config
*/
-static int create_proc_entries( void )
+static int create_proc_entries(void)
{
struct proc_config_entry proc_config[NB_PORTS];
int ret;
- printk("Creating /proc entries: ");
+ printk("Creating /proc entries: ");
- /* Create main directory */
- proc_mkdir(GPIO_PROC_DIRNAME, NULL);
+ /* Create main directory */
+ proc_mkdir(GPIO_PROC_DIRNAME, NULL);
- /* Create proc file to handle GPIO values */
+ /* Create proc file to handle GPIO values */
proc_config[PORT_A].name = GPIO_PROC_PORTA_FILENAME;
proc_config[PORT_A].type = VALUE;
proc_config[PORT_B].name = GPIO_PROC_PORTB_FILENAME;
@@ -809,11 +739,11 @@
proc_config[PORT_D].name = GPIO_PROC_PORTD_FILENAME;
proc_config[PORT_D].type = VALUE;
- if( (ret = initialize_entry(proc_config)) )
+ if ((ret = initialize_entry(proc_config)))
return ret;
init_map |= GPIO_PROC_FILE;
- /* Create proc file to handle GPIO direction settings */
+ /* Create proc file to handle GPIO direction settings */
proc_config[PORT_A].name = GPIO_PROC_PORTADIR_FILENAME;
proc_config[PORT_A].type = DIRECTION;
proc_config[PORT_B].name = GPIO_PROC_PORTBDIR_FILENAME;
@@ -823,7 +753,7 @@
proc_config[PORT_D].name = GPIO_PROC_PORTDDIR_FILENAME;
proc_config[PORT_D].type = DIRECTION;
- if( (ret = initialize_entry(proc_config)) )
+ if ((ret = initialize_entry(proc_config)))
return ret;
init_map |= SETTINGS_PROC_FILE;
@@ -837,7 +767,7 @@
proc_config[PORT_D].name = GPIO_PROC_PORTD_IRQ_FILENAME;
proc_config[PORT_D].type = INTERRUPT;
- if( (ret = initialize_entry(proc_config)) )
+ if ((ret = initialize_entry(proc_config)))
return ret;
init_map |= SETTINGS_IRQ_PROC_FILE;
@@ -851,126 +781,114 @@
proc_config[PORT_D].name = GPIO_PROC_PORTD_PULLUP_FILENAME;
proc_config[PORT_D].type = PULL_UP;
- if( (ret = initialize_entry(proc_config)) )
+ if ((ret = initialize_entry(proc_config)))
return ret;
init_map |= SETTINGS_PULLUP_PROC_FILE;
- printk("OK!\n");
- return(0);
+ printk("OK!\n");
+ return(0);
}
-//
-// /dev functionnalities supported:
-//
+static void remove_proc_entries(void)
+{
+ /* Remove /proc entries */
+ if (init_map & GPIO_PROC_FILE) {
+ printk( DRIVER_NAME " removing " GPIO_PROC_PORTA_FILENAME " & Co\n" );
+ remove_proc_entry( GPIO_PROC_PORTA_FILENAME, NULL);
+ remove_proc_entry( GPIO_PROC_PORTB_FILENAME, NULL);
+ remove_proc_entry( GPIO_PROC_PORTC_FILENAME, NULL);
+ remove_proc_entry( GPIO_PROC_PORTD_FILENAME, NULL);
+ }
+ if (init_map & SETTINGS_PROC_FILE) {
+ printk( DRIVER_NAME " removing " GPIO_PROC_PORTADIR_FILENAME " & Co\n" );
+ remove_proc_entry( GPIO_PROC_PORTADIR_FILENAME, NULL);
+ remove_proc_entry( GPIO_PROC_PORTBDIR_FILENAME, NULL);
+ remove_proc_entry( GPIO_PROC_PORTCDIR_FILENAME, NULL);
+ remove_proc_entry( GPIO_PROC_PORTDDIR_FILENAME, NULL);
+ }
+ if (init_map & SETTINGS_IRQ_PROC_FILE) {
+ printk( DRIVER_NAME " removing " GPIO_PROC_PORTA_IRQ_FILENAME " & Co\n" );
+ remove_proc_entry( GPIO_PROC_PORTA_IRQ_FILENAME, NULL);
+ remove_proc_entry( GPIO_PROC_PORTB_IRQ_FILENAME, NULL);
+ remove_proc_entry( GPIO_PROC_PORTC_IRQ_FILENAME, NULL);
+ remove_proc_entry( GPIO_PROC_PORTD_IRQ_FILENAME, NULL);
+ }
+ if (init_map & SETTINGS_PULLUP_PROC_FILE) {
+ printk( DRIVER_NAME " removing " GPIO_PROC_PORTA_PULLUP_FILENAME " & Co\n" );
+ remove_proc_entry( GPIO_PROC_PORTA_PULLUP_FILENAME, NULL);
+ remove_proc_entry( GPIO_PROC_PORTB_PULLUP_FILENAME, NULL);
+ remove_proc_entry( GPIO_PROC_PORTC_PULLUP_FILENAME, NULL);
+ remove_proc_entry( GPIO_PROC_PORTD_PULLUP_FILENAME, NULL);
+ }
+
+ remove_proc_entry(GPIO_PROC_DIRNAME, NULL);
+}
+/* /dev functionnalities supported: */
static struct file_operations gpio_fops = {
- .owner = THIS_MODULE,
+ .owner = THIS_MODULE,
.llseek = no_llseek,
- .write = armadeus_gpio_dev_write,
- .read = armadeus_gpio_dev_read,
- .open = armadeus_gpio_dev_open,
- .release = armadeus_gpio_dev_release,
- .ioctl = armadeus_gpio_dev_ioctl,
+ .write = armadeus_gpio_dev_write,
+ .read = armadeus_gpio_dev_read,
+ .open = armadeus_gpio_dev_open,
+ .release = armadeus_gpio_dev_release,
+ .ioctl = armadeus_gpio_dev_ioctl,
};
-//
-// Module's initialization function
-//
+/* Module's initialization */
static int __init armadeus_gpio_init(void)
{
- static int result, i;
+ static int result, i;
+
+ printk("Initializing Armadeus GPIOs driver\n");
+ printk(" PortA Parameters (%i): ", portA_init_nb);
+ for (i = 0; i < NB_CONFIG_REGS; i++) { printk(" 0x%x", portA_init[i]); } printk("\n");
+ printk(" PortB Parameters (%i): ", portB_init_nb);
+ for (i = 0; i < NB_CONFIG_REGS; i++ ) { printk(" 0x%x", portB_init[i]); } printk("\n");
+ printk(" PortC Parameters (%i): ", portC_init_nb);
+ for (i = 0; i < NB_CONFIG_REGS; i++ ) { printk(" 0x%x", portC_init[i]); } printk("\n");
+ printk(" PortD Parameters (%i): ", portD_init_nb);
+ for (i = 0; i < NB_CONFIG_REGS; i++ ) { printk(" 0x%x", portD_init[i]); } printk("\n");
+ init_map = 0;
- printk("Initializing Armadeus GPIOs driver\n");
- printk(" PortA Parameters (%i): ", portA_init_nb); for( i=0; i< NB_CONFIG_REGS; i++ ) { printk(" 0x%x", portA_init[i]); } printk("\n");
- printk(" PortB Parameters (%i): ", portB_init_nb); for( i=0; i< NB_CONFIG_REGS; i++ ) { printk(" 0x%x", portB_init[i]); } printk("\n");
- printk(" PortC Parameters (%i): ", portC_init_nb); for( i=0; i< NB_CONFIG_REGS; i++ ) { printk(" 0x%x", portC_init[i]); } printk("\n");
- printk(" PortD Parameters (%i): ", portD_init_nb); for( i=0; i< NB_CONFIG_REGS; i++ ) { printk(" 0x%x", portD_init[i]); } printk("\n");
- init_map = 0;
+ /* Configure HW ports/GPIOs with default values or given parameters */
+ initialize_all_ports();
- // Configure HW ports/GPIOs with default values or given parameters
- initializePorts();
+ /* Register the driver as character device by getting a major number */
+ result = register_chrdev(gpio_major, DRIVER_NAME, &gpio_fops);
+ if (result < 0) {
+ printk(KERN_WARNING DRIVER_NAME ": can't get major %d\n", gpio_major);
+ return result;
+ }
+ if (gpio_major == 0) gpio_major = result; /* dynamic Major allocation */
- /* Register the driver as character device by getting a major number */
- result = register_chrdev(gpio_major, DRIVER_NAME, &gpio_fops);
- if (result < 0)
- {
- printk(KERN_WARNING DRIVER_NAME ": can't get major %d\n", gpio_major);
- return result;
- }
- if( gpio_major == 0 ) gpio_major = result; /* dynamic Major allocation */
-
/* Creates /proc entries */
- if( (result = create_proc_entries()) ) {
- armadeus_gpio_cleanup();
- return( result );
+ if ((result = create_proc_entries())) {
+ remove_proc_entries();
+ return result;
}
- // Initialise GPIO port access semaphore
- sema_init(&gpio_sema, 1);
+ /* Initialise GPIO port access semaphore */
+ sema_init(&gpio_sema, 1);
- // Set GPIOs to initial state
- // iMX and parameters will do it
+ /* Set GPIOs to initial state: iMX and parameters will do it */
- printk( DRIVER_NAME " " DRIVER_VERSION " successfully loaded !\n");
-
- return(0);
+ printk( DRIVER_NAME " " DRIVER_VERSION " successfully loaded !\n");
+ return 0;
}
-//
-// Module's cleanup function
-//
+/* Module's cleanup */
static void __exit armadeus_gpio_cleanup(void)
{
- printk("Cleanup:\n");
-
/* TBDJUJU free config[i].entry->data first ?? */
+ remove_proc_entries();
- // Remove /proc entries
- if( init_map & GPIO_PROC_FILE )
- {
- printk( DRIVER_NAME " removing " GPIO_PROC_PORTA_FILENAME " & Co\n" );
- remove_proc_entry( GPIO_PROC_PORTA_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTB_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTC_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTD_FILENAME, NULL);
- }
- if( init_map & SETTINGS_PROC_FILE )
- {
- printk( DRIVER_NAME " removing " GPIO_PROC_PORTADIR_FILENAME " & Co\n" );
- remove_proc_entry( GPIO_PROC_PORTADIR_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTBDIR_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTCDIR_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTDDIR_FILENAME, NULL);
- }
- if( init_map & SETTINGS_IRQ_PROC_FILE )
- {
- printk( DRIVER_NAME " removing " GPIO_PROC_PORTA_IRQ_FILENAME " & Co\n" );
- remove_proc_entry( GPIO_PROC_PORTA_IRQ_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTB_IRQ_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTC_IRQ_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTD_IRQ_FILENAME, NULL);
- }
- if( init_map & SETTINGS_PULLUP_PROC_FILE )
- {
- printk( DRIVER_NAME " removing " GPIO_PROC_PORTA_PULLUP_FILENAME " & Co\n" );
- remove_proc_entry( GPIO_PROC_PORTA_PULLUP_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTB_PULLUP_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTC_PULLUP_FILENAME, NULL);
- remove_proc_entry( GPIO_PROC_PORTD_PULLUP_FILENAME, NULL);
- }
-
- remove_proc_entry(GPIO_PROC_DIRNAME, NULL);
-
- /* De-register from /dev interface */
- unregister_chrdev(gpio_major, DRIVER_NAME);
-
- printk("Ok !\n");
+ /* De-register from /dev interface */
+ unregister_chrdev(gpio_major, DRIVER_NAME);
}
-//------------------------------------------------
-//
-// API TBDJUJU To be removed......
-//
-
+/*
+ * API To be removed ???
+ */
void gpioWriteOnPort( unsigned int aPort, unsigned int aValue )
{
if( aPort >= NB_PORTS ) { aPort = NB_PORTS - 1; printk(DRIVER_NAME "port unknown !\n"); return; }
Modified: trunk/target/linux/modules/gpio/ppdevemu.c
===================================================================
--- trunk/target/linux/modules/gpio/ppdevemu.c 2009-03-10 12:50:55 UTC (rev 1138)
+++ trunk/target/linux/modules/gpio/ppdevemu.c 2009-03-10 14:32:12 UTC (rev 1139)
@@ -1,5 +1,9 @@
/*
- **********************************************************************
+ * Armadeus Parallel port (ppdev) emulator
+ *
+ * Copyright (C) 2006-2009 Julien Boibessot <jul...@ar...>
+ * Armadeus Project / Armadeus Systems
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
@@ -13,31 +17,33 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- **********************************************************************
+ *
*/
-/*#define GPIO_PROC_FILE 1
-#define LED_PROC_FILE 2
-#define SETTINGS_PROC_FILE 4
-#define TEMP_PROC_FILE 8
-#define VOLT_PROC_FILE 16*/
-
-//#include "common.h"
-#include "ppdevemu.h"
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/proc_fs.h>
+#include <asm/uaccess.h>
#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
-#include <asm/arch/imx-regs.h>
-#else
-#include <mach/imx-regs.h>
-#endif
#include <linux/moduleparam.h>
+/* Pretend we're PPDEV for IOCTL */
+#include <linux/ppdev.h>
+
extern void gpioWriteOnPort( unsigned int, unsigned int );
extern unsigned int gpioReadFromPort( unsigned int );
extern void gpioSetPortDir( unsigned int, unsigned int );
extern unsigned int gpioGetPortDir( unsigned int );
+#define DRIVER_VERSION "v0.1"
+#define PPDEV_DEVICE_NAME "Armadeus_ppdev"
+/* by default, we use dynamic allocation of major numbers */
+#define PPDEV_MAJOR 0
+#define PPDEV_MAX_MAJOR 254
+#define PPDEV_MINOR 0
+#define PPDEV_MAX_MINOR 4
+
#define PORT_A 0
#define PORT_B 1
#define PORT_C 2
@@ -61,328 +67,236 @@
static unsigned int gPortCIndex = PORT_C;
static unsigned int gPortDIndex = PORT_D;*/
-static unsigned char port_mode = 8; // 8bits mode by default
+static unsigned char port_mode = 8; /* 8bits mode by default */
module_param( port_mode, byte, 0 );
+MODULE_PARM_DESC(port_mode, "Choose between 8 or 4 bits mode");
+
void __exit armadeus_ppdev_cleanup(void);
-//------------------------------------------------
-//
-// Low level functions
-//
-static void initializePorts( void )
+/*
+ * Low level functions
+ */
+static void initialize_port( void )
{
- // If not already done by core module
- GIUS(PORT_D) = GIUS(PORT_D) | PORT_D_31_10_MASK; //set only portD 31..10
- PUEN(PORT_D) = PUEN(PORT_D) | PORT_D_31_10_MASK;
- OCR1(PORT_D) = OCR1(PORT_D) | 0xFFFF0000;
- OCR2(PORT_D) = OCR2(PORT_D) | 0xFFFFFFFF;
+ /* If not already done by core module */
+ GIUS(PORT_D) = GIUS(PORT_D) | PORT_D_31_10_MASK; /* set only portD 31..10 */
+ PUEN(PORT_D) = PUEN(PORT_D) | PORT_D_31_10_MASK;
+ OCR1(PORT_D) = OCR1(PORT_D) | 0xFFFF0000;
+ OCR2(PORT_D) = OCR2(PORT_D) | 0xFFFFFFFF;
}
-//------------------------------------------------
-//
-// Handles write() done on /dev/ppdevxx
-//
+/* Handles write() done on /dev/ppdevxx */
/*static ssize_t armadeus_ppdev_write(struct file *file, const char *data, size_t count, loff_t *ppos)
{
}*/
-//
-// Handles read() done on /dev/ppdevxx
-//
+/* Handles read() done on /dev/ppdevxx */
/*static ssize_t armadeus_ppdev_read(struct file *file, char *buf, size_t count, loff_t *ppos)
{
}*/
-//------------------------------------------------
-//
-// Handles open() system call done on /dev/...
-//
+/* Handles open() system call done on /dev/... */
static int armadeus_ppdev_open(struct inode *inode, struct file *file)
{
- unsigned m = MINOR(inode->i_rdev);
- if( m != PPDEV_MINOR /*MINOR_BYTE && m != MINOR_FULL && m != MINOR_LED*/ )
- {
- printk("Not the right parport minor\n");
- return -EINVAL;
- }
+ unsigned m = MINOR(inode->i_rdev);
+ if (m != PPDEV_MINOR) {
+ printk("Not the right parport minor\n");
+ return -EINVAL;
+ }
- printk("Opening /dev/ppdev%d file\n", m);
- return 0;
+ pr_debug("Opening /dev/ppdev%d file\n", m);
+ return 0;
}
-//------------------------------------------------
-//
-// Handles close() system call done on /dev/...
-//
+/* Handles close() system call done on /dev/... */
static int armadeus_ppdev_release(struct inode *inode, struct file *file)
{
- printk("Closing access to /dev/ppdev\n");
- return 0;
+ pr_debug("Closing access to /dev/ppdev\n");
+ return 0;
}
-//------------------------------------------------
-
-// PROC file
-static int procfile_ppdev_read( char *buffer, __attribute__ ((unused)) char **start, off_t offset, int buffer_length, int *eof, __attribute__ ((unused)) void* data)
-{
- int len; /* The number of bytes actually used */
-
- // We give all of our information in one go, so if the user asks us if we have more information the answer should always be no.
- // This is important because the standard read function from the library would continue to issue the read system call until
- // the kernel replies that it has no more information, or until its buffer is filled.
-
- if( (offset > 0) || (buffer_length < /*MIN_SIZE_OF_PROC*/32) )
- {
- return 0;
- }
-
-/* if (down_interruptible(&fpga_sema))
- return -ERESTARTSYS; */
-
- // Get the status of the fpga TBDNICO
-
- // Put status to given buffer
- len = sprintf(buffer, "Nothing to say yet :-) !\n");
-
- //*start = buffer;
- *eof = 1;
-/* up(&fpga_sema); */
-
- // Return the length
- return len;
-}
-
-
-static int procfile_ppdev_write( __attribute__ ((unused)) struct file *file, const char *buf, unsigned long count, void *data)
-{
- int len = 0;
-
- printk( "Not supported !\n" );
-
- return len;
-}
-
-
-//------------------------------------------------
-// Handling of some PPDEV IOCTL calls
-//
+/* Handling of some PPDEV IOCTL calls */
int armadeus_ppdev_ioctl( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg )
{
- int err = 0; int ret = 0;
- int value=0;
- unsigned int minor;
- unsigned int lShadow = 0;
- unsigned int PP_DDIR_MASK=0;
+ int err = 0; int ret = 0;
+ int value=0;
+ unsigned int minor;
+ unsigned int lShadow = 0;
+ unsigned int PP_DDIR_MASK=0;
- //printk(" ## IOCTL received: (0x%x) ##\n", cmd);
-
- // Extract the type and number bitfields, and don't decode wrong cmds: return ENOTTY (inappropriate ioctl) before access_ok()
- if (_IOC_TYPE(cmd) != PP_IOCTL) return -ENOTTY;
+ pr_debug(" ## IOCTL received: (0x%x) ##\n", cmd);
- // The direction is a bitmask, and VERIFY_WRITE catches R/W transfers. `Type' is user-oriented, while access_ok is kernel-oriented,
- // so the concept of "read" and "write" is reversed
- if (_IOC_DIR(cmd) & _IOC_READ)
- err = !access_ok(VERIFY_WRITE, (void *)arg, _IOC_SIZE(cmd));
- else if (_IOC_DIR(cmd) & _IOC_WRITE)
- err = !access_ok(VERIFY_READ, (void *)arg, _IOC_SIZE(cmd));
+ /* Extract the type and number bitfields, and don't decode wrong cmds:
+ return ENOTTY (inappropriate ioctl) before access_ok() */
+ if (_IOC_TYPE(cmd) != PP_IOCTL)
+ return -ENOTTY;
- if (err) return -EFAULT;
+ /* The direction is a bitmask, and VERIFY_WRITE catches R/W transfers.
+ `Type' is user-oriented, while access_ok is kernel-oriented,
+ so the concept of "read" and "write" is reversed */
+ if (_IOC_DIR(cmd) & _IOC_READ)
+ err = !access_ok(VERIFY_WRITE, (void *)arg, _IOC_SIZE(cmd));
+ else if (_IOC_DIR(cmd) & _IOC_WRITE)
+ err = !access_ok(VERIFY_READ, (void *)arg, _IOC_SIZE(cmd));
+ if (err)
+ return -EFAULT;
- if (down_interruptible(&ppdev_sema))
- return -ERESTARTSYS;
+ if (down_interruptible(&ppdev_sema))
+ return -ERESTARTSYS;
- minor = MINOR(inode->i_rdev);
- if( minor > PPDEV_MAX_MINOR ) {
- printk("Minor outside range: %d !\n", minor);
- return -EFAULT;
- }
-
- switch(cmd)
- {
- case PPCLAIM:
- case PPRELEASE:
- break;
- case PPFCONTROL: // Normally not used in 4bits mode because in this case control signals are generated with data port
- ret = __get_user(value, (unsigned char *)arg);
- // Write ctrl infos on assigned ctrl ppdevlines how ???
- printk("/FROB 0x%x/ ", value);
- // Get value from port and clear bits we will set
- lShadow = gpioReadFromPort( PORT_D );
- // Control lines are on PortD[14,13,12]
- lShadow &= 0xFFFF8FFF;
- //Control are written on iMX LCD Port control in GPIO mode, ie PortD[14,13,12]
- lShadow |= ((value & 0x0F) << 12);
- // Put it on port
- gpioWriteOnPort( PORT_D, lShadow );
- printk(" 0x%x /", lShadow);
- break;
+ minor = MINOR(inode->i_rdev);
+ if( minor > PPDEV_MAX_MINOR ) {
+ printk("Minor outside range: %d !\n", minor);
+ return -EFAULT;
+ }
- // IOCTL used to write on data register of the simulated parallel port
- // We will ask LCD4LINUX to use 4 bits mode for controlling the LCD and to use the 4 remaining data line as control lines
- // So, 4 lowest bit received as argument are data and 4 highest bits are control
- // !! Minor number is ignored for all PPDEV IOCTLs !!
- case PPWDATA:
- ret = __get_user(value, (unsigned char *)arg);
-// printk("/WD 0x%x ", value);
- if (ret==0) {
- // Get value from port and clear bits we will set
- lShadow = gpioReadFromPort( PORT_D );
- if( port_mode == 4 ) {
- lShadow &= 0xFF000FFF; //0xFFF00FFF;
- //Control (4 highest bits) are written on iMX LCD Port control in GPIO mode, ie PortD[14,13,12]
- lShadow |= ((value & 0x70) << (12-4));
- //Data (4 lowest bits) are writtten on iMX LCD port data in GPIO mode, ie PortD[18-15]
- lShadow |= ((value & 0x0F) << (15+4));
- } else {
- lShadow &= 0xFF807FFF;
- lShadow |= ((value & 0xFF) << 15);
- }
- gpioWriteOnPort( PORT_D, lShadow );
-// printk(" 0x%x /", lShadow);
- }
- break;
+ switch (cmd)
+ {
+ case PPCLAIM:
+ case PPRELEASE:
+ break;
- case PPRDATA:
- if( port_mode == 4 ) {
- // Data (4 lowest bits) are read from iMX LCD port data in GPIO mode, ie PortD[18-15]
- value = (gpioReadFromPort( PORT_D ) >> (15+4)) & 0x0F;
- } else {
- value = (gpioReadFromPort( PORT_D ) >> 15) & 0xFF;
- }
- //
- ret = __put_user(value, (unsigned char *)arg);
- printk("/RD 0x%x/ ", value);
- break;
+ case PPFCONTROL: // Normally not used in 4bits mode because in this case control signals are generated with data port
+ ret = __get_user(value, (unsigned char *)arg);
+ /* Write ctrl infos on assigned ctrl ppdevlines how ??? */
+ printk("/FROB 0x%x/ ", value);
+ /* Get value from port and clear bits we will set */
+ lShadow = gpioReadFromPort( PORT_D );
+ /* Control lines are on PortD[14,13,12] */
+ lShadow &= 0xFFFF8FFF;
+ /* Control are written on iMX LCD Port control in GPIO mode, ie PortD[14,13,12] */
+ lShadow |= ((value & 0x0F) << 12);
+ /* Put it on port */
+ gpioWriteOnPort( PORT_D, lShadow );
+ printk(" 0x%x /", lShadow);
+ break;
- case PPDATADIR:
- ret = __get_user(value, (unsigned char *)arg);
- printk("/DIR 0x%x/ ", value);
-
- if( port_mode == 4 )
- PP_DDIR_MASK = 0xFF807FFF; // 1111 1111 1111 1000 0111 1111 1111 1111 ??
- else
- PP_DDIR_MASK = 0xFF807FFF; // 1111 1111 1000 0000 0111 1111 1111 1111
-
- /* linux/ppdev.h define PPDATADIR as "Data line direction: non-zero for input mode."
- For ppdevs, the logic is reversed - bit=1 == output
- This is _not_ "generic" at all, but very much hard-wired towards being able to use an HD44780 LCD on the GPIO pins
- (in 4-bit mode) and being able to do so using generic ppdev instructions
- So, GPIO4-GPIO7 (=ctrl signals) will _always_ be set to output for this call, only GPIO0-GPIO3 (=datalines) are changed */
- if( ret == 0 )
- {
- lShadow = gpioGetPortDir( PORT_D );
- //only 4 data lines can be set to ouput/input, control lines are always output...
- if( value==0 ) {
- gpioSetPortDir( PORT_D, (lShadow | (!PP_DDIR_MASK)) );
- } else {
- gpioSetPortDir( PORT_D, (lShadow & PP_DDIR_MASK) );
- }
- } else {
- printk(PPDEV_DEVICE_NAME ": ret=%x\n", ret);
- }
- break;
+ /* IOCTL used to write on data register of the simulated
+ parallel port. We will ask LCD4LINUX to use 4 bits mode
+ for controlling the LCD and to use the 4 remaining data
+ line as control lines.
+ So, 4 lowest bit received as argument are data and
+ 4 highest bits are control
+ !! Minor number is ignored for all PPDEV IOCTLs !! */
+ case PPWDATA:
+ ret = __get_user(value, (unsigned char *)arg);
+ /*printk("/WD 0x%x ", value);*/
+ if (ret !=0 )
+ break;
- default:
- return -ENOTTY;
- break;
- }
+ /* Get value from port and clear bits we will set */
+ lShadow = gpioReadFromPort( PORT_D );
+ if (port_mode == 4) {
+ lShadow &= 0xFF000FFF; //0xFFF00FFF;
+ /* Control (4 highest bits) are written on iMX LCD
+ Port control in GPIO mode, ie PortD[14,13,12] */
+ lShadow |= ((value & 0x70) << (12-4));
+ /* Data (4 lowest bits) are written on iMX LCD port
+ data in GPIO mode, ie PortD[18-15] */
+ lShadow |= ((value & 0x0F) << (15+4));
+ } else {
+ lShadow &= 0xFF807FFF;
+ lShadow |= ((value & 0xFF) << 15);
+ }
+ gpioWriteOnPort( PORT_D, lShadow );
+ /*printk(" 0x%x /", lShadow); */
+ break;
- up(&ppdev_sema);
+ case PPRDATA:
+ if (port_mode == 4) {
+ /* Data (4 lowest bits) are read from iMX LCD port data
+ in GPIO mode, ie PortD[18-15] */
+ value = (gpioReadFromPort( PORT_D ) >> (15+4)) & 0x0F;
+ } else {
+ value = (gpioReadFromPort( PORT_D ) >> 15) & 0xFF;
+ }
+
+ ret = __put_user(value, (unsigned char *)arg);
+ printk("/RD 0x%x/ ", value);
+ break;
- return ret;
-}
+ case PPDATADIR:
+ ret = __get_user(value, (unsigned char *)arg);
+ printk("/DIR 0x%x/ ", value);
+
+ if (port_mode == 4)
+ PP_DDIR_MASK = 0xFF807FFF; /* 1111 1111 1111 1000 0111 1111 1111 1111 ?? */
+ else
+ PP_DDIR_MASK = 0xFF807FFF; /* 1111 1111 1000 0000 0111 1111 1111 1111 */
+
+ /* linux/ppdev.h define PPDATADIR as "Data line direction: non-zero for input mode."
+ For ppdevs, the logic is reversed - bit=1 == output
+ This is _not_ "generic" at all, but very much hard-wired towards being able to use an HD44780 LCD on the GPIO pins
+ (in 4-bit mode) and being able to do so using generic ppdev instructions
+ So, GPIO4-GPIO7 (=ctrl signals) will _always_ be set to output for this call, only GPIO0-GPIO3 (=datalines) are changed */
+ if (ret == 0) {
+ lShadow = gpioGetPortDir( PORT_D );
+ /* only 4 data lines can be set to ouput/input, control lines are always output...*/
+ if (value==0) {
+ gpioSetPortDir( PORT_D, (lShadow | (!PP_DDIR_MASK)) );
+ } else {
+ gpioSetPortDir( PORT_D, (lShadow & PP_DDIR_MASK) );
+ }
+ } else {
+ printk(PPDEV_DEVICE_NAME ": ret=%x\n", ret);
+ }
+ break;
-//
-// Create /proc entries for direct access (with echo/cat) to GPIOs config
-//
-static int createProcEntries( void )
-{
- static struct proc_dir_entry* pPPDEVProcFile;
- //
- printk("Creating /proc entries: ");
- // Create main directory
- proc_mkdir(PPDEV_PROC_DIRNAME, NULL);
- // Create proc file to handle GPIO values
- pPPDEVProcFile = create_proc_entry( PPDEV_PROC_FILENAME, S_IWUSR |S_IRUSR | S_IRGRP | S_IROTH, NULL);
+ default:
+ return -ENOTTY;
+ break;
+ }
- if( pPPDEVProcFile == NULL )
- {
- printk(KERN_ERR PPDEV_DEVICE_NAME ": Could not register " PPDEV_PROC_FILENAME ". Terminating\n");
- armadeus_ppdev_cleanup();
- return -ENOMEM;
- }
- else
- {
- pPPDEVProcFile->read_proc = procfile_ppdev_read;
- pPPDEVProcFile->write_proc = procfile_ppdev_write;
- //init_map |= GPIO_PROC_FILE;
- }
-
- printk("OK!\n");
- return(0);
+ up(&ppdev_sema);
+
+ return ret;
}
static struct file_operations ppdev_fops = {
- .owner = THIS_MODULE,
-// .write = armadeus_ppdev_write,
-// .read = armadeus_ppdev_read,
- .open = armadeus_ppdev_open,
- .release = armadeus_ppdev_release,
- .ioctl = armadeus_ppdev_ioctl,
+ .owner = THIS_MODULE,
+ /*.write = armadeus_ppdev_write,
+ .read = armadeus_ppdev_read,*/
+ .open = armadeus_ppdev_open,
+ .release = armadeus_ppdev_release,
+ .ioctl = armadeus_ppdev_ioctl,
};
-//
-// Module's initialization function
-//
+
int __init armadeus_ppdev_init(void)
{
- static int result;
+ static int result;
- printk("Initializing Armadeus Parallel Port emulation driver\n");
- printk(" Port mode: %d bits\n", port_mode );
- init_map = 0;
-
- // Configure HW ports/GPIOs with default values or given parameters
- initializePorts();
-
- // Register the driver by getting a major number
- result = register_chrdev(ppdev_major, PPDEV_DEVICE_NAME, &ppdev_fops);
- if (result < 0) {
- printk(KERN_WARNING PPDEV_DEVICE_NAME ": can't get major %d\n", ppdev_major);
- return result;
- }
- // Dynamic Major allocation
- if( ppdev_major == 0 )
- ppdev_major = result;
+ printk("Initializing Armadeus Parallel Port emulation driver\n");
+ printk(" Port mode: %d bits\n", port_mode );
+ init_map = 0;
- // Creating /proc entries
- result = createProcEntries();
- if( result < 0 ) return( result );
-
- // Initialise GPIO port access semaphore
- sema_init(&ppdev_sema, 1);
+ /* Configure HW ports/GPIOs with default values or given parameters */
+ initialize_port();
- printk("Armadeus Parallel Port emulation driver " DRIVER_VERSION " successfully loaded !\n");
+ /* Register the driver by getting a major number */
+ result = register_chrdev(ppdev_major, PPDEV_DEVICE_NAME, &ppdev_fops);
+ if (result < 0) {
+ printk(KERN_WARNING PPDEV_DEVICE_NAME ": can't get major %d\n", ppdev_major);
+ return result;
+ }
+ /* Dynamic Major allocation */
+ if( ppdev_major == 0 )
+ ppdev_major = result;
- return(0);
+ /* Initialise GPIO port access semaphore */
+ sema_init(&ppdev_sema, 1);
+
+ printk(DRIVER_VERSION " successfully loaded !\n");
+
+ return(0);
}
-//
-// Module's cleanup function
-//
void __exit armadeus_ppdev_cleanup(void)
{
- printk("PPDEV cleanup: ");
- remove_proc_entry( PPDEV_PROC_FILENAME, NULL );
- remove_proc_entry( PPDEV_PROC_DIRNAME, NULL);
- printk("2 ");
- unregister_chrdev(ppdev_major, PPDEV_DEVICE_NAME);
-
- printk("Ok !\n ");
+ unregister_chrdev(ppdev_major, PPDEV_DEVICE_NAME);
}
-//------------------------------------------------
module_init(armadeus_ppdev_init);
module_exit(armadeus_ppdev_cleanup);
Deleted: trunk/target/linux/modules/gpio/ppdevemu.h
===================================================================
--- trunk/target/linux/modules/gpio/ppdevemu.h 2009-03-10 12:50:55 UTC (rev 1138)
+++ trunk/target/linux/modules/gpio/ppdevemu.h 2009-03-10 14:32:12 UTC (rev 1139)
@@ -1,80 +0,0 @@
-/*
- **********************************************************************
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- **********************************************************************
-*/
-
-#ifndef __PPDEV_EMU_H__
-#define __PPDEV_EMU_H__
-
-#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
-#include <linux/config.h>
-#endif
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/fs.h>
-#include <linux/errno.h>
-#include <linux/types.h>
-#include <linux/proc_fs.h>
-#include <linux/init.h>
-#include <linux/fs.h>
-#include <linux/fcntl.h>
-#include <asm/system.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <linux/pci.h>
-
-#define PPDEV_PROC_DIRNAME "driver/ppdev"
-#define PPDEV_PROC_FILENAME PPDEV_PROC_DIRNAME "/infos"
-
-/*#define LED_PROC_FILENAME "driver/armadeus_error_led"
-#define SETTINGS_PROC_FILENAME "driver/portBdir"
-#define TEMPERATURE_PROC_FILENAME "driver/soekris_temp"
-#define VOLTAGE_PROC_FILENAME "driver/soekris_voltage"*/
-#define DRIVER_VERSION "v0.0"
-//#define VERSION "soekris"
-
-/* by default, we use dynamic allocation of major numbers */
-#define PPDEV_MAJOR 0
-#define PPDEV_MAX_MAJOR 254
-
-// /* minor numbers used*/
-// #define MINOR_BYTE 0 /* access to GPIO0-GPIO7 */
-// #define MINOR_FULL 1 /* access to GPIO0-GPIOxx (driver dependant) */
-// #define MINOR_LED 254 /* access to the error LED */
-// #define GPIO_MAX_MINOR 4
-#define PPDEV_MINOR 0
-#define PPDEV_MAX_MINOR 4
-
-// /* Read/write bitmask that determines input/output pins (1 means output, 0 input) */
-// #define GPIORDDIRECTION _IOR(PP_IOCTL, 0xF0, int)
-// #define GPIOWRDIRECTION _IOW(PP_IOCTL, 0xF1, int)
-//
-// /* Read/write data */
-// #define GPIORDDATA _IOR(PP_IOCTL, 0xF2, int)
-// #define GPIOWRDATA _IOW(PP_IOCTL, 0xF3, int)
-
-// #define MAX_NUMBER_OF_PINS 32
-// #define TEMPERATURE_BUFFER_SIZE 256
-// #define VOLTAGE_BUFFER_SIZE 512
-
-#define PPDEV_DEVICE_NAME "Armadeus_ppdev"
-
-// Pretend we're PPDEV for IOCTL
-#include <linux/ppdev.h>
-
-
-#endif // __PPDEV_EMU_H__
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <th...@us...> - 2009-03-10 12:50:59
|
Revision: 1138
http://armadeus.svn.sourceforge.net/armadeus/?rev=1138&view=rev
Author: thom25
Date: 2009-03-10 12:50:55 +0000 (Tue, 10 Mar 2009)
Log Message:
-----------
[LINUX] fix ethernet autonegotiation bug
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/297-apf27-armadeus-add_ethernet_PHY.patch
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/297-apf27-armadeus-add_ethernet_PHY.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/297-apf27-armadeus-add_ethernet_PHY.patch 2009-03-10 12:34:06 UTC (rev 1137)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/297-apf27-armadeus-add_ethernet_PHY.patch 2009-03-10 12:50:55 UTC (rev 1138)
@@ -26,7 +26,7 @@
+ {mk_mii_end,}
+};
+static phy_cmd_t const phy_cmd_lan8700_startup[] = { /* startup - enable interrupts */
-+ {mk_mii_write(MII_REG_ANAR, 0x01E0), NULL},
++ {mk_mii_write(MII_REG_ANAR, 0x01E1), NULL},
+ {mk_mii_write(MII_REG_CR, 0x1200), NULL}, /* autonegotiate */
+ {mk_mii_read(MII_REG_SR), mii_parse_sr},
+ {mk_mii_end,}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <th...@us...> - 2009-03-10 12:34:21
|
Revision: 1137
http://armadeus.svn.sourceforge.net/armadeus/?rev=1137&view=rev
Author: thom25
Date: 2009-03-10 12:34:06 +0000 (Tue, 10 Mar 2009)
Log Message:
-----------
[U-BOOT] fix ethernet autonegotiation bug
Modified Paths:
--------------
trunk/buildroot/target/u-boot/u-boot-1.3.4-300-imx27.patch
Modified: trunk/buildroot/target/u-boot/u-boot-1.3.4-300-imx27.patch
===================================================================
--- trunk/buildroot/target/u-boot/u-boot-1.3.4-300-imx27.patch 2009-03-10 09:39:05 UTC (rev 1136)
+++ trunk/buildroot/target/u-boot/u-boot-1.3.4-300-imx27.patch 2009-03-10 12:34:06 UTC (rev 1137)
@@ -2658,7 +2658,7 @@
+#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \
+ ADVERTISE_CSMA)
+#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \
-+ ADVERTISE_100HALF | ADVERTISE_100FULL)
++ ADVERTISE_100HALF | ADVERTISE_100FULL|ADVERTISE_CSMA)
+
+/* Link partner ability register. */
+#define LPA_SLCT 0x001f /* Same as advertise selector */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-03-10 09:39:15
|
Revision: 1136
http://armadeus.svn.sourceforge.net/armadeus/?rev=1136&view=rev
Author: artemys
Date: 2009-03-10 09:39:05 +0000 (Tue, 10 Mar 2009)
Log Message:
-----------
[TEST] Add test for watchdog
Added Paths:
-----------
trunk/target/test/test_watchdog.sh
Added: trunk/target/test/test_watchdog.sh
===================================================================
--- trunk/target/test/test_watchdog.sh (rev 0)
+++ trunk/target/test/test_watchdog.sh 2009-03-10 09:39:05 UTC (rev 1136)
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+#
+# Script to test Armadeus Software release
+#
+# Copyright (C) 2008 The Armadeus Project
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+
+source ./test_helpers.sh
+source ./test_env.sh
+
+WATCHDOG_DEV="/dev/watchdog"
+SEC=5
+
+test_watchdog()
+{
+ show_test_banner "Watchdog"
+
+ ask_user "This test will reboot your board. Continue ? (y/n)"
+ if [ "$response" != "y" ]; then
+ exit_failed
+ fi
+
+ modprobe imx-wdt timeout=$SEC
+ if [ "$?" != 0 ] || [ ! -c "$WATCHDOG_DEV" ] ; then
+ echo "Module failed to load"
+ exit_failed
+ fi
+
+ watchdog -t $(($SEC-2)) /dev/watchdog
+ if [ "$?" != 0 ]; then
+ echo "Failed to launch userspace helper"
+ exit_failed
+ fi
+
+ ask_user "Press ENTER to reboot your system after $SEC seconds"
+
+ killall watchdog
+ sleep $(($SEC+2))
+
+ echo "You didn't reboot"
+ exit_failed
+}
+
+test_watchdog
+
Property changes on: trunk/target/test/test_watchdog.sh
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gwe...@us...> - 2009-03-10 09:17:30
|
Revision: 1135
http://armadeus.svn.sourceforge.net/armadeus/?rev=1135&view=rev
Author: gwenhael
Date: 2009-03-10 09:17:17 +0000 (Tue, 10 Mar 2009)
Log Message:
-----------
[BUILDROOT] Xenomai integration (pass 2)
Added Paths:
-----------
trunk/patches/072-buildroot-xenomai-package.diff
Added: trunk/patches/072-buildroot-xenomai-package.diff
===================================================================
--- trunk/patches/072-buildroot-xenomai-package.diff (rev 0)
+++ trunk/patches/072-buildroot-xenomai-package.diff 2009-03-10 09:17:17 UTC (rev 1135)
@@ -0,0 +1,25 @@
+diff -ruN buildroot/package/Config.in buildroot.new/package/Config.in
+--- buildroot.new/package/Config.in 2009-03-09 16:57:56.000000000 +0100
++++ package/Config.in 2009-02-24 11:33:56.000000000 +0100
+@@ -121,6 +121,8 @@
+ source "package/which/Config.in"
+ endif
+
++source "package/xenomai/Config.in"
++
+ source "package/database/Config.in"
+
+ if !BR2_PACKAGE_BUSYBOX_HIDE_OTHERS
+diff -urN buildroot/target/linux/Makefile.in.advanced buildroot.new/target/linux/Makefile.in.advanced
+--- buildroot/target/linux/Makefile.in.advanced 2009-02-24 11:42:16.000000000 +0100
++++ buildroot.new/target/linux/Makefile.in.advanced 2009-02-24 11:40:07.000000000 +0100
+@@ -278,6 +278,9 @@
+ toolchain/patch-kernel.sh $(LINUX26_DIR) package/openswan \
+ linux-$(LINUX26_VERSION)\*.patch{,.gz,.bz2}
+ endif
++ifeq ($(BR2_PACKAGE_XENOMAI),y)
++ make -C ../buildroot xenomai-patch-kernel
++endif
+ touch $@
+
+ $(LINUX26_DIR)/.patched.arch: $(LINUX26_DIR)/.patched
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gwe...@us...> - 2009-03-10 08:49:34
|
Revision: 1134
http://armadeus.svn.sourceforge.net/armadeus/?rev=1134&view=rev
Author: gwenhael
Date: 2009-03-10 08:49:22 +0000 (Tue, 10 Mar 2009)
Log Message:
-----------
[BUILDROOT] Xenomai integration (pass 1)
Added Paths:
-----------
trunk/buildroot/package/xenomai/
trunk/buildroot/package/xenomai/01-adeos-2.6.27-1.12-00.patch
trunk/buildroot/package/xenomai/04-suppr-patch.patch
trunk/buildroot/package/xenomai/Config.in
trunk/buildroot/package/xenomai/xenomai.mk
Added: trunk/buildroot/package/xenomai/01-adeos-2.6.27-1.12-00.patch
===================================================================
--- trunk/buildroot/package/xenomai/01-adeos-2.6.27-1.12-00.patch (rev 0)
+++ trunk/buildroot/package/xenomai/01-adeos-2.6.27-1.12-00.patch 2009-03-10 08:49:22 UTC (rev 1134)
@@ -0,0 +1,24 @@
+diff -ru a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c
+--- a/arch/arm/mach-imx/irq.c 2009-02-17 11:32:52.000000000 +0100
++++ b/arch/arm/mach-imx/irq.c 2009-02-23 14:12:43.000000000 +0100
+@@ -35,7 +35,7 @@
+ #include <asm/io.h>
+
+ #include <asm/mach/irq.h>
+-#include <asm/arch/imx-regs.h>
++#include <mach/imx-regs.h>
+
+
+ /* Used for IMX INTERRUPT priority: Still Experimental */
+diff -ru a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
+--- a/arch/arm/mach-imx/time.c 2009-02-25 17:03:34.000000000 +0100
++++ b/arch/arm/mach-imx/time.c 2009-02-25 16:36:16.000000000 +0100
+@@ -294,6 +294,8 @@
+ #ifdef CONFIG_IPIPE
+ void __ipipe_mach_acktimer(void)
+ {
++ uint32_t tstat;
++ tstat = IMX_TSTAT(TIMER_BASE);
+ IMX_TSTAT(TIMER_BASE) = 0;
+ }
+
Added: trunk/buildroot/package/xenomai/04-suppr-patch.patch
===================================================================
--- trunk/buildroot/package/xenomai/04-suppr-patch.patch (rev 0)
+++ trunk/buildroot/package/xenomai/04-suppr-patch.patch 2009-03-10 08:49:22 UTC (rev 1134)
@@ -0,0 +1,10 @@
+--- a/arch/arm/mach-imx/include/mach/imx-regs.h
++++ b/arch/arm/mach-imx/include/mach/imx-regs.h
+@@ -411,7 +411,6 @@
+ #define PCR_BPIX_8 (3<<25)
+ #define PCR_BPIX_12 (4<<25)
+ #define PCR_BPIX_16 (4<<25)
+-#define PCR_BPIX_MASK (7<<25)
+ #define PCR_PIXPOL (1<<24)
+ #define PCR_FLMPOL (1<<23)
+ #define PCR_LPPOL (1<<22)
Added: trunk/buildroot/package/xenomai/Config.in
===================================================================
--- trunk/buildroot/package/xenomai/Config.in (rev 0)
+++ trunk/buildroot/package/xenomai/Config.in 2009-03-10 08:49:22 UTC (rev 1134)
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_XENOMAI
+ bool "Xenomai"
+ help
+ Real-Time Framework for Linux
+
+ http://xenomai.org
+
Added: trunk/buildroot/package/xenomai/xenomai.mk
===================================================================
--- trunk/buildroot/package/xenomai/xenomai.mk (rev 0)
+++ trunk/buildroot/package/xenomai/xenomai.mk 2009-03-10 08:49:22 UTC (rev 1134)
@@ -0,0 +1,104 @@
+#############################################################
+#
+# xenomai :
+# URL : http://xenomai.org
+# NOTE : Real-Time Framework for Linux
+#
+# adeos :
+# URL : http://home.gna.org/adeos/
+# NOTE : The purpose of Adeos is to provide a flexible
+# environment for sharing hardware resources among
+# multiple operating systems, or among multiple
+# instances of a single OS.
+#
+#############################################################
+
+XENOMAI_VERSION:=2.4.7
+XENOMAI_SOURCE:=xenomai-$(XENOMAI_VERSION).tar.bz2
+XENOMAI_SITE:=http://download.gna.org/xenomai/stable
+XENOMAI_DIR:=$(BUILD_DIR)/xenomai-$(XENOMAI_VERSION)
+XENOMAI_CAT:=bzcat
+XENOMAI_BINARY:=xeno-load
+XENOMAI_TARGET_BINARY:=usr/xenomai/bin/xeno-load
+
+ADEOS_VERSION:=1.12-00
+
+ADEOS_SOURCE:=adeos-ipipe-$(strip $(subst ",,$(BR2_KERNEL_THIS_VERSION)))-arm-$(ADEOS_VERSION).patch
+#"
+ADEOS_SITE:=http://download.gna.org/adeos/patches/v2.6/arm/older/
+
+$(DL_DIR)/$(XENOMAI_SOURCE):
+ $(WGET) -P $(DL_DIR) $(XENOMAI_SITE)/$(XENOMAI_SOURCE)
+
+$(DL_DIR)/$(ADEOS_SOURCE):
+ $(WGET) -P $(DL_DIR) $(ADEOS_SITE)$(ADEOS_SOURCE)
+
+xenomai-source: $(DL_DIR)/$(ADEOS_SOURCE)
+
+$(XENOMAI_DIR)/.unpacked: $(DL_DIR)/$(XENOMAI_SOURCE)
+ $(XENOMAI_CAT) $(DL_DIR)/$(XENOMAI_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
+ touch $@
+
+xenomai-test: $(XENOMAI_DIR)/.patch
+
+$(LINUX_DIR)/.patch_xenomai: $(DL_DIR)/$(ADEOS_SOURCE) $(XENOMAI_DIR)/.unpacked
+ if [ -f "$(LINUX_DIR)/.patched.board" ]; then \
+ toolchain/patch-kernel.sh $(LINUX26_DIR) package/xenomai \
+ 04-suppr-patch.patch; \
+ fi
+ toolchain/patch-kernel.sh $(LINUX26_DIR) $(DL_DIR) \
+ $(ADEOS_SOURCE)
+ toolchain/patch-kernel.sh $(LINUX26_DIR) package/xenomai \
+ 01-adeos-2.6.27-1.12-00.patch
+ if [ ! -f "$(LINUX_DIR)/.patched.board" ]; then \
+ toolchain/patch-kernel.sh $(LINUX26_DIR) package/xenomai \
+ 04-suppr-patch.patch; \
+ fi
+ $(XENOMAI_DIR)/scripts/prepare-kernel.sh \
+ --linux=${LINUX_DIR} \
+ --arch=arm
+ touch $@
+
+xenomai-patch-kernel: $(LINUX_DIR)/.patch_xenomai
+
+$(XENOMAI_DIR)/.configured: xenomai-patch-kernel
+ (cd $(XENOMAI_DIR); rm -rf config.cache; \
+ $(TARGET_CONFIGURE_OPTS) \
+ $(TARGET_CONFIGURE_ARGS) \
+ CCFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
+ ./configure \
+ --enable-arm-mach=imx \
+ --host=arm-linux \
+ --datarootdir=/xenodoc \
+ )
+ touch $@
+
+$(XENOMAI_DIR)/scripts/$(XENOMAI_BINARY): $(XENOMAI_DIR)/.configured
+ $(MAKE) -C $(XENOMAI_DIR) \
+ CC="$(TARGET_CC)" LD="$(TARGET_LD)"
+
+$(TARGET_DIR)/$(XENOMAI_TARGET_BINARY): $(XENOMAI_DIR)/scripts/$(XENOMAI_BINARY)
+ $(MAKE) -C $(XENOMAI_DIR) \
+ CC=$(TARGET_CC) LD=$(TARGET_LD) \
+ DESTDIR=$(TARGET_DIR) install
+ rm -rf $(TARGET_DIR)/xenodoc
+ echo "/usr/xenomai/lib" > $(TARGET_DIR)/etc/ld.so.conf
+ echo -e 'export PATH=/usr/xenomai/bin:$${PATH}' >> $(TARGET_DIR)/etc/profile
+
+xenomai: uclibc kernel-headers $(TARGET_DIR)/$(XENOMAI_TARGET_BINARY)
+
+xenomai-clean:
+ $(MAKE) DESTDIR=$(TARGET_DIR) -C $(XENOMAI_DIR) uninstall
+ -$(MAKE) DESTDIR=$(TARGET_DIR) -C $(XENOMAI_DIR) clean
+
+xenomai-dirclean:
+ rm -rf $(XENOMAI_DIR)
+
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_XENOMAI)),y)
+TARGETS+=xenomai
+endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-03-09 18:57:10
|
Revision: 1133
http://armadeus.svn.sourceforge.net/armadeus/?rev=1133&view=rev
Author: artemys
Date: 2009-03-09 18:56:50 +0000 (Mon, 09 Mar 2009)
Log Message:
-----------
[LINUX] Add watchdog driver (only usable on APF27 for the moment)
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.27.13.config
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/281-apf27-armadeus-add_apf27.c.patch
Added Paths:
-----------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/315-apf27-darius-mxc-watchdog.patch
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/316-apf27-armadeus-watchdog-makes_darius_driver_work_on_mx27.patch
Modified: trunk/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.27.13.config
===================================================================
--- trunk/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.27.13.config 2009-03-09 11:57:16 UTC (rev 1132)
+++ trunk/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.27.13.config 2009-03-09 18:56:50 UTC (rev 1133)
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.27.13
-# Wed Mar 4 18:26:21 2009
+# Sun Mar 8 22:58:54 2009
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -830,9 +830,21 @@
# CONFIG_SENSORS_W83627HF is not set
# CONFIG_SENSORS_W83627EHF is not set
# CONFIG_HWMON_DEBUG_CHIP is not set
-# CONFIG_WATCHDOG is not set
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_IMX_WDT=m
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+
+#
# Sonics Silicon Backplane
#
CONFIG_SSB_POSSIBLE=y
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/281-apf27-armadeus-add_apf27.c.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/281-apf27-armadeus-add_apf27.c.patch 2009-03-09 11:57:16 UTC (rev 1132)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/281-apf27-armadeus-add_apf27.c.patch 2009-03-09 18:56:50 UTC (rev 1133)
@@ -1,6 +1,9 @@
+PATCH AUTOMATICALLY GENERATED
+DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
+(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.13.original/arch/arm/mach-mx2/apf27.c
+++ linux-2.6.27.13.mod/arch/arm/mach-mx2/apf27.c
-@@ -0,0 +1,1331 @@
+@@ -0,0 +1,1334 @@
+ /*
+ * apf27.c
+ *
@@ -1273,6 +1276,9 @@
+ mxc_register_device(&mxc_uart_device2, &uart_pdata[1]);
+ /*mxc_register_device(&mxc_uart_device2, &uart_pdata[2]);*/
+ mxc_register_device(&mxc_nand_device, &apf27_nand_board_info);
++#ifdef CONFIG_WATCHDOG
++ mxc_register_device(&mxc_wdt, NULL);
++#endif
+#ifdef CONFIG_USB_EHCI_MXC
+ mxc_register_device(&mxc_otg, &ehci0_pdata);
+ mxc_register_device(&mxc_ehci1, &ehci1_pdata);
Added: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/315-apf27-darius-mxc-watchdog.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/315-apf27-darius-mxc-watchdog.patch (rev 0)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/315-apf27-darius-mxc-watchdog.patch 2009-03-09 18:56:50 UTC (rev 1133)
@@ -0,0 +1,484 @@
+From: Darius Augulis <aug...@gm...>
+
+Driver for watchdog timer on Freesale IMX processors.
+
+Signed-off-by: Darius Augulis <aug...@gm...>
+
+Index: linux-2.6.29-rc5/drivers/watchdog/Kconfig
+===================================================================
+--- linux-2.6.29-rc5.orig/drivers/watchdog/Kconfig
++++ linux-2.6.29-rc5/drivers/watchdog/Kconfig
+@@ -66,6 +66,18 @@ config WM8350_WATCHDOG
+
+ # ARM Architecture
+
++config IMX_WDT
++ tristate "IMX Watchdog"
++ depends on ARCH_MXC
++ help
++ This is the driver for the hardware watchdog
++ on the Freescale IMX processors.
++ If you have one of these processors and wish to have
++ watchdog support enabled, say Y, otherwise say N.
++
++ To compile this driver as a module, choose M here: the
++ module will be called imx_wdt.
++
+ config AT91RM9200_WATCHDOG
+ tristate "AT91RM9200 watchdog"
+ depends on ARCH_AT91RM9200
+Index: linux-2.6.29-rc5/drivers/watchdog/Makefile
+===================================================================
+--- linux-2.6.29-rc5.orig/drivers/watchdog/Makefile
++++ linux-2.6.29-rc5/drivers/watchdog/Makefile
+@@ -41,6 +41,7 @@ obj-$(CONFIG_PNX4008_WATCHDOG) += pnx400
+ obj-$(CONFIG_PNX4008_WATCHDOG) += pnx4008_wdt.o
+ obj-$(CONFIG_IOP_WATCHDOG) += iop_wdt.o
+ obj-$(CONFIG_DAVINCI_WATCHDOG) += davinci_wdt.o
++obj-$(CONFIG_IMX_WDT) += imx-wdt.o
+
+ # ARM26 Architecture
+
+Index: linux-2.6.29-rc5/drivers/watchdog/imx-wdt.c
+===================================================================
+--- /dev/null
++++ linux-2.6.29-rc5/drivers/watchdog/imx-wdt.c
+@@ -0,0 +1,432 @@
++/*
++ * Watchdog driver for IMX processors
++ *
++ * Copyright (C) 2008 Darius Augulis <aug...@gm...>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ */
++
++/*
++ * NOTE: MX1 arch has a bit different Watchdog than MX2 and MX3.
++ * It's not possible to turn off watchdog on MX2 or MX3 since it's enabled.
++ * Timeout changing with IOCTL command is possible only on MX1.
++ * WD timer halting during suspend is implemented in all archs but in
++ * different way.
++ * MX2 and MX3 has 16 bit watchdog registers compared to 32 bit on MX1.
++ *
++ */
++
++/*#define DEBUG*/
++
++#include <linux/init.h>
++#include <linux/kernel.h>
++#include <linux/miscdevice.h>
++#include <linux/module.h>
++#include <linux/moduleparam.h>
++#include <linux/platform_device.h>
++#include <linux/types.h>
++#include <linux/fs.h>
++#include <linux/io.h>
++#include <linux/bitops.h>
++#include <linux/errno.h>
++#include <linux/watchdog.h>
++#include <linux/uaccess.h>
++#include <mach/hardware.h>
++#include <linux/clk.h>
++
++#ifdef CONFIG_ARCH_MX1
++# define WDT_MAX_TIME 63 /* seconds */
++
++# define IMX_WDT_WCR 0x00 /* Control reg */
++# define IMX_WDT_WSR 0x04 /* Service reg */
++# define IMX_WDT_WSTR 0x08 /* Status reg */
++
++# define WCR_WT (0x7F<<8)
++# define WCR_WDEC (1<<1)
++# define WCR_WDE (1<<0)
++# define WCR_WHALT (1<<15)
++#else
++# define WDT_MAX_TIME 127 /* seconds */
++
++# define IMX_WDT_WCR 0x00 /* Control reg */
++# define IMX_WDT_WSR 0x02 /* Service reg */
++# define IMX_WDT_WSTR 0x04 /* Status reg */
++
++# define WCR_WT (0xFF<<8)
++# define WCR_WDE (1<<2)
++# define WCR_WDZST (1<<0)
++#endif
++
++#define WDT_DEFAULT_TIME 10 /* seconds */
++#define WDT_SEQ1 0x5555
++#define WDT_SEQ2 0xAAAA
++
++static struct platform_device *imx_wdt_dev;
++
++struct imx_wdt_struct {
++ struct resource *res;
++ struct device *dev;
++ struct clk *clk;
++ void __iomem *base;
++ int wdt_time;
++ int nowayout;
++ unsigned long status;
++};
++
++static unsigned int timeout = WDT_DEFAULT_TIME;
++
++static struct watchdog_info imx_wdt_info = {
++ .identity = "imx watchdog",
++ .options = WDIOF_KEEPALIVEPING
++#ifdef CONFIG_ARCH_MX1
++ | WDIOF_SETTIMEOUT
++#endif
++};
++
++/* Disable the watchdog. */
++static inline void imx_wdt_stop(struct imx_wdt_struct *imx_wdt)
++{
++ dev_dbg(imx_wdt->dev, "<%s>\n", __func__);
++
++#ifdef CONFIG_ARCH_MX1
++ __raw_writew(0, imx_wdt->base + IMX_WDT_WCR);
++#else
++ dev_info(imx_wdt->dev, "watchdog is unstoppable on i.MX2/3 !\n");
++#endif
++}
++
++/* Enable and reset the watchdog. */
++static inline void imx_wdt_start(struct imx_wdt_struct *imx_wdt)
++{
++ u16 temp;
++
++ dev_dbg(imx_wdt->dev, "<%s>\n", __func__);
++
++ temp = __raw_readw(imx_wdt->base + IMX_WDT_WCR);
++ temp |= imx_wdt->wdt_time << 8;
++ __raw_writew(temp, imx_wdt->base + IMX_WDT_WCR);
++
++#ifdef CONFIG_ARCH_MX1
++# ifndef CONFIG_WATCHDOG_NOWAYOUT
++ temp |= WCR_WDEC;
++ __raw_writew(temp, imx_wdt->base + IMX_WDT_WCR);
++# endif
++ temp |= WCR_WDE;
++ __raw_writew(temp, imx_wdt->base + IMX_WDT_WCR);
++#else
++ temp |= WCR_WDE | WCR_WDZST;
++ __raw_writew(temp, imx_wdt->base + IMX_WDT_WCR);
++#endif
++
++#ifdef CONFIG_ARCH_MX1
++ __raw_writew(WDT_SEQ1, imx_wdt->base + IMX_WDT_WSR);
++ __raw_writew(WDT_SEQ2, imx_wdt->base + IMX_WDT_WSR);
++#endif
++}
++
++/* Service the watchdog */
++static inline void imx_wdt_service(struct imx_wdt_struct *imx_wdt)
++{
++ dev_dbg(imx_wdt->dev, "<%s>\n", __func__);
++
++ __raw_writew(WDT_SEQ1, imx_wdt->base + IMX_WDT_WSR);
++ __raw_writew(WDT_SEQ2, imx_wdt->base + IMX_WDT_WSR);
++}
++
++/* Watchdog device is opened, and watchdog starts running. */
++static int imx_wdt_open(struct inode *inode, struct file *file)
++{
++ struct imx_wdt_struct *imx_wdt = platform_get_drvdata(imx_wdt_dev);
++
++ dev_dbg(imx_wdt->dev, "<%s>\n", __func__);
++
++ if (test_and_set_bit(0, &imx_wdt->status))
++ return -EBUSY;
++
++ file->private_data = imx_wdt;
++
++ imx_wdt_start(imx_wdt);
++ return nonseekable_open(inode, file);
++}
++
++/* Close the watchdog device. */
++static int imx_wdt_close(struct inode *inode, struct file *file)
++{
++ struct imx_wdt_struct *imx_wdt = file->private_data;
++
++ dev_dbg(imx_wdt->dev, "<%s>\n", __func__);
++
++ /* Disable the watchdog if possible */
++ if (!imx_wdt->nowayout)
++ imx_wdt_stop(imx_wdt);
++
++ clear_bit(0, &imx_wdt->status);
++ return 0;
++}
++
++#ifdef CONFIG_ARCH_MX1
++/* Change the watchdog time interval. */
++static int imx_wdt_settimeout(struct imx_wdt_struct *imx_wdt, int new_time)
++{
++ dev_dbg(imx_wdt->dev, "<%s>\n", __func__);
++
++ if ((new_time * 2 < 1) || (new_time * 2 > WDT_MAX_TIME))
++ return -EINVAL;
++
++ imx_wdt->wdt_time = new_time * 2;
++ return 0;
++}
++#endif
++
++/* Handle commands from user-space. */
++static int imx_wdt_ioctl(struct inode *inode, struct file *file,
++ unsigned int cmd, unsigned long arg)
++{
++ struct imx_wdt_struct *imx_wdt = file->private_data;
++
++ void __user *argp = (void __user *)arg;
++ int __user *p = argp;
++#ifdef CONFIG_ARCH_MX1
++ int new_value;
++#endif
++
++ dev_dbg(imx_wdt->dev, "<%s>\n", __func__);
++
++ switch (cmd) {
++ case WDIOC_KEEPALIVE:
++ imx_wdt_service(imx_wdt);
++ return 0;
++
++ case WDIOC_GETSUPPORT:
++ return copy_to_user(argp, &imx_wdt_info,
++ sizeof(imx_wdt_info)) ? -EFAULT : 0;
++#ifdef CONFIG_ARCH_MX1
++ case WDIOC_SETTIMEOUT:
++ if (get_user(new_value, p))
++ return -EFAULT;
++
++ if (imx_wdt_settimeout(imx_wdt, new_value))
++ return -EINVAL;
++
++ /* Enable new time value */
++ imx_wdt_start(imx_wdt);
++
++ /* Return current value */
++ return put_user(imx_wdt->wdt_time / 2, p);
++#endif
++ case WDIOC_GETTIMEOUT:
++ return put_user(imx_wdt->wdt_time / 2, p);
++
++ default:
++ return -ENOTTY;
++ }
++}
++
++/* Refresh the watchdog whenever device is written to. */
++static ssize_t imx_wdt_write(struct file *file, const char *data,
++ size_t len, loff_t *ppos)
++{
++ struct imx_wdt_struct *imx_wdt = file->private_data;
++
++ dev_dbg(imx_wdt->dev, "<%s>\n", __func__);
++
++ imx_wdt_service(imx_wdt);
++ return len;
++}
++
++static const struct file_operations imx_wdt_fops = {
++ .owner = THIS_MODULE,
++ .llseek = no_llseek,
++ .ioctl = imx_wdt_ioctl,
++ .open = imx_wdt_open,
++ .release = imx_wdt_close,
++ .write = imx_wdt_write,
++};
++
++static struct miscdevice imx_wdt_miscdev = {
++ .minor = WATCHDOG_MINOR,
++ .name = "watchdog",
++ .fops = &imx_wdt_fops,
++};
++
++static void imx_wdt_shutdown(struct platform_device *pdev)
++{
++ struct imx_wdt_struct *imx_wdt = platform_get_drvdata(pdev);
++
++ dev_dbg(imx_wdt->dev, "<%s>\n", __func__);
++
++ imx_wdt_stop(imx_wdt);
++}
++
++static int __init imx_wdt_probe(struct platform_device *pdev)
++{
++ int ret;
++ int res_size;
++ struct resource *res;
++ void __iomem *base;
++ struct imx_wdt_struct *imx_wdt;
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res) {
++ dev_err(&pdev->dev, "can't get device resources\n");
++ return -ENODEV;
++ }
++
++ res_size = res->end - res->start + 1;
++ if (!request_mem_region(res->start, res_size, res->name)) {
++ dev_err(&pdev->dev, "can't allocate %d bytes at %d address\n",
++ res_size, res->start);
++ return -ENOMEM;
++ }
++
++ base = ioremap(res->start, res_size);
++ if (!base) {
++ dev_err(&pdev->dev, "ioremap failed\n");
++ ret = -EIO;
++ goto fail0;
++ }
++
++ imx_wdt = kzalloc(sizeof(struct imx_wdt_struct), GFP_KERNEL);
++ if (!imx_wdt) {
++ dev_err(&pdev->dev, "can't allocate interface\n");
++ ret = -ENOMEM;
++ goto fail1;
++ }
++
++ imx_wdt->clk = clk_get(&pdev->dev, "wdog_clk");
++ if (IS_ERR(imx_wdt->clk)) {
++ dev_err(&pdev->dev, "can't get Watchdog clock\n");
++ ret = PTR_ERR(imx_wdt->clk);
++ goto fail2;
++ }
++ clk_enable(imx_wdt->clk);
++
++ /* Setup imx_wdt driver structure */
++ imx_wdt->dev = &pdev->dev;
++ imx_wdt->base = base;
++ imx_wdt->res = res;
++ imx_wdt->wdt_time = timeout * 2;
++#ifdef CONFIG_WATCHDOG_NOWAYOUT
++ imx_wdt->nowayout = 1;
++#else
++ imx_wdt->nowayout = 0;
++#endif
++
++ /* Set up platform driver data */
++ platform_set_drvdata(pdev, imx_wdt);
++ imx_wdt_dev = pdev;
++
++ if (imx_wdt_miscdev.parent) {
++ ret = -EBUSY;
++ goto fail3;
++ }
++ imx_wdt_miscdev.parent = &pdev->dev;
++
++ ret = misc_register(&imx_wdt_miscdev);
++ if (ret)
++ goto fail3;
++
++ dev_dbg(&pdev->dev, "IMX Watchdog Timer enabled\n");
++ return 0;
++
++fail3:
++ clk_disable(imx_wdt->clk);
++ clk_put(imx_wdt->clk);
++fail2:
++ platform_set_drvdata(pdev, NULL);
++ kfree(imx_wdt);
++fail1:
++ iounmap(base);
++fail0:
++ release_mem_region(res->start, res_size);
++
++ return ret; /* Return error number */
++}
++
++static int __exit imx_wdt_remove(struct platform_device *pdev)
++{
++ struct imx_wdt_struct *imx_wdt = platform_get_drvdata(pdev);
++
++ dev_dbg(&pdev->dev, "IMX Watchdog Timer disabled\n");
++
++ platform_set_drvdata(pdev, NULL);
++ misc_deregister(&imx_wdt_miscdev);
++ imx_wdt_dev = NULL;
++ iounmap(imx_wdt->base);
++ release_mem_region(imx_wdt->res->start,
++ imx_wdt->res->end - imx_wdt->res->start + 1);
++
++ clk_disable(imx_wdt->clk);
++ clk_put(imx_wdt->clk);
++
++ kfree(imx_wdt);
++ return 0;
++}
++
++#ifdef CONFIG_PM
++
++static int imx_wdt_suspend(struct platform_device *pdev, pm_message_t message)
++{
++#ifdef CONFIG_ARCH_MX1
++ struct imx_wdt_struct *imx_wdt = platform_get_drvdata(pdev);
++
++ u32 temp = __raw_readw(imx_wdt->base + IMX_WDT_WCR);
++ __raw_writew(temp | WCR_WHALT, imx_wdt->base + IMX_WDT_WCR);
++#endif
++ return 0;
++}
++
++static int imx_wdt_resume(struct platform_device *pdev)
++{
++#ifdef CONFIG_ARCH_MX1
++ struct imx_wdt_struct *imx_wdt = platform_get_drvdata(pdev);
++ u32 temp;
++
++ if (imx_wdt->status) {
++ temp = __raw_readw(imx_wdt->base + IMX_WDT_WCR) & ~WCR_WHALT;
++ __raw_writew(temp, imx_wdt->base + IMX_WDT_WCR);
++ }
++#endif
++ return 0;
++}
++
++#else
++#define imx_wdt_suspend NULL
++#define imx_wdt_resume NULL
++#endif
++
++static struct platform_driver imx_wdt_driver = {
++ .probe = imx_wdt_probe,
++ .remove = __exit_p(imx_wdt_remove),
++ .shutdown = imx_wdt_shutdown,
++ .suspend = imx_wdt_suspend,
++ .resume = imx_wdt_resume,
++ .driver = {
++ .name = "imx-wdt",
++ .owner = THIS_MODULE,
++ },
++};
++
++static int __init imx_wdt_init(void)
++{
++ return platform_driver_probe(&imx_wdt_driver, imx_wdt_probe);
++}
++
++static void __exit imx_wdt_exit(void)
++{
++ platform_driver_unregister(&imx_wdt_driver);
++}
++module_init(imx_wdt_init);
++module_exit(imx_wdt_exit);
++
++module_param(timeout, uint, 0);
++MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds");
++
++MODULE_AUTHOR("Darius Augulis");
++MODULE_DESCRIPTION("Watchdog driver for IMX");
++MODULE_LICENSE("GPL");
++MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
++MODULE_ALIAS("platform:imx-wdt");
+-------------------------------------------------------------------
+List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
+FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
+Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
+
+
Added: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/316-apf27-armadeus-watchdog-makes_darius_driver_work_on_mx27.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/316-apf27-armadeus-watchdog-makes_darius_driver_work_on_mx27.patch (rev 0)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.13/316-apf27-armadeus-watchdog-makes_darius_driver_work_on_mx27.patch 2009-03-09 18:56:50 UTC (rev 1133)
@@ -0,0 +1,15 @@
+diff -urN -X linux-2.6.27.13/Documentation/dontdiff linux-2.6.27.13/drivers/watchdog/imx-wdt.c linux-2.6.27.13.mod/drivers/watchdog/imx-wdt.c
+--- linux-2.6.27.13/drivers/watchdog/imx-wdt.c 2009-03-09 19:15:42.000000000 +0100
++++ linux-2.6.27.13.mod/drivers/watchdog/imx-wdt.c 2009-03-09 19:09:54.000000000 +0100
+@@ -405,7 +405,11 @@
+ .suspend = imx_wdt_suspend,
+ .resume = imx_wdt_resume,
+ .driver = {
++#ifdef CONFIG_MACH_MX1
+ .name = "imx-wdt",
++#else
++ .name = "mxc_wdt",
++#endif
+ .owner = THIS_MODULE,
+ },
+ };
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <th...@us...> - 2009-03-09 11:57:33
|
Revision: 1132
http://armadeus.svn.sourceforge.net/armadeus/?rev=1132&view=rev
Author: thom25
Date: 2009-03-09 11:57:16 +0000 (Mon, 09 Mar 2009)
Log Message:
-----------
[U-BOOT] allow env to start in the next good sector of the flash
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/apf27/apf27.h
Modified: trunk/buildroot/target/device/armadeus/apf27/apf27.h
===================================================================
--- trunk/buildroot/target/device/armadeus/apf27/apf27.h 2009-03-09 10:32:47 UTC (rev 1131)
+++ trunk/buildroot/target/device/armadeus/apf27/apf27.h 2009-03-09 11:57:16 UTC (rev 1132)
@@ -536,7 +536,8 @@
/*#define CFG_ENV_IS_NOWHERE
*/
#define CFG_ENV_OFFSET 0x000A0000 /* NAND offset address for now*/
-#define CFG_ENV_SIZE 0x00060000 /* 384kB ( 3 flash blocks ) */
+#define CFG_ENV_SIZE 0x00020000 /* 128kB */
+#define CFG_ENV_RANGE 0X00060000 /* 384kB ( 3 flash blocks ) */
#define CONFIG_ENV_OVERWRITE 1 /* env is writable now */
#define CONFIG_FIRMWARE_OFFSET 0x00100000
#define CONFIG_FIRMWARE_LEN 0x00080000 /* 512kB ( 4 flash blocks ) */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|