2 File: include/asm-arm/hc_sl811-hw.h
5 /* The base_addr, data_reg_addr, and irq number are board specific.
6 * The current values are design to run on the Accelent SA1110 IDP
7 * NOTE: values need to modify for different development boards
10 #define SIZEOF_IO_REGION 256 /* Size for request/release region */
11 static int base_addr = 0xd3800000;
12 static int data_reg_addr = 0xd3810000;
13 static int irq = 34; /* Also change SL811_SET_GPDR! */
14 static int gprd = 13; /* also change irq !!! */
16 MODULE_PARM (base_addr, "i");
17 MODULE_PARM_DESC (base_addr, "sl811 base address 0xd3800000");
18 MODULE_PARM (data_reg_addr, "i");
19 MODULE_PARM_DESC (data_reg_addr, "sl811 data register address 0xd3810000");
20 MODULE_PARM (irq, "i");
21 MODULE_PARM_DESC (irq, "IRQ 34 (default)");
22 MODULE_PARM(gprd,"i");
23 MODULE_PARM_DESC(gprd,"sl811 GPRD port 13(default)");
26 * Low level: Read from Data port [arm]
28 static __u8 inline sl811_read_data (hcipriv_t *hp)
31 data = readb (hp->hcport2);
37 * Low level: Write to index register [arm]
39 static void inline sl811_write_index (hcipriv_t *hp, __u8 index)
41 writeb (offset, hp->hcport);
46 * Low level: Write to Data port [arm]
48 static void inline sl811_write_data (hcipriv_t *hp, __u8 data)
50 writeb (data, hp->hcport2);
54 * Low level: Write to index register and data port [arm]
56 static void inline sl811_write_index_data (hcipriv_t *hp, __u8 index, __u8 data)
58 writeb (offset, hp->hcport);
59 writeb (data, hp->hcport2);
63 /*****************************************************************
65 * Function Name: init_irq [arm]
67 * This function is board specific. It sets up the interrupt to
68 * be an edge trigger and trigger on the rising edge
74 *****************************************************************/
75 static void inline init_irq (void)
78 set_GPIO_IRQ_edge (1 << gprd, GPIO_RISING_EDGE);
81 /*****************************************************************
83 * Function Name: release_regions [arm]
85 * This function is board specific. It frees all io address.
91 *****************************************************************/
92 static void inline release_regions (hcipriv_t *hp)
95 release_region (hp->hcport, SIZEOF_IO_REGION);
99 if (hp->hcport2 > 0) {
100 release_region (hp->hcport2, SIZEOF_IO_REGION);
105 /*****************************************************************
107 * Function Name: request_regions [arm]
109 * This function is board specific. It request all io address and
110 * maps into memory (if can).
114 * Return value : 0 = OK
116 *****************************************************************/
117 static int inline request_regions (hcipriv_t *hp, int addr1, int addr2)
119 if (!request_region (addr1, SIZEOF_IO_REGION, "SL811 USB HOST")) {
120 DBGERR ("request address %d failed", addr1);
125 DBGERR ("Error mapping SL811 Memory 0x%x", addr1);
128 if (!request_region (addr2, SIZEOF_IO_REGION, "SL811 USB HOST")) {
129 DBGERR ("request address %d failed", addr2);
134 DBGERR ("Error mapping SL811 Memory 0x%x", addr2);