41 static const u32 regs[] = { 0xe100, 0xe28c };
42 u32 data = nv_ro32(bios, entry);
43 u8 line = (data & 0x0000001f);
44 u8 func = (data & 0x0000ff00) >> 8;
45 u8 defs = !!(data & 0x01000000);
46 u8 unk0 = !!(data & 0x02000000);
47 u8 unk1 = !!(data & 0x04000000);
48 u32 val = (unk1 << 16) | unk0;
49 u32 reg = regs[line >> 4]; line &= 0x0f;
54 gpio->
set(gpio, 0, func, line, defs);
56 nv_mask(priv, reg, 0x00010001 << line, val << line);
61 nv50_gpio_location(
int line,
u32 *reg,
u32 *shift)
63 const u32 nv50_gpio_reg[4] = { 0xe104, 0xe108, 0xe280, 0xe284 };
68 *reg = nv50_gpio_reg[line >> 3];
69 *shift = (line & 7) << 2;
78 if (nv50_gpio_location(line, ®, &shift))
81 nv_mask(gpio, reg, 7 << shift, (((dir ^ 1) << 1) | out) << shift);
90 if (nv50_gpio_location(line, ®, &shift))
93 return !!(nv_rd32(gpio, reg) & (4 << shift));
99 u32 reg = line < 16 ? 0xe050 : 0xe070;
100 u32 mask = 0x00010001 << (line & 0xf);
102 nv_wr32(gpio, reg + 4, mask);
103 nv_mask(gpio, reg + 0, mask, on ? mask : 0);
110 u32 intr0, intr1 = 0;
113 intr0 = nv_rd32(priv, 0xe054) & nv_rd32(priv, 0xe050);
114 if (nv_device(priv)->
chipset >= 0x90)
115 intr1 = nv_rd32(priv, 0xe074) & nv_rd32(priv, 0xe070);
117 hi = (intr0 & 0x0000ffff) | (intr1 << 16);
118 lo = (intr0 >> 16) | (intr1 & 0xffff0000);
119 priv->
base.isr_run(&priv->
base, 0, hi | lo);
121 nv_wr32(priv, 0xe054, intr0);
122 if (nv_device(priv)->
chipset >= 0x90)
123 nv_wr32(priv, 0xe074, intr1);
135 *pobject = nv_object(priv);
139 priv->
base.reset = nv50_gpio_reset;
140 priv->
base.drive = nv50_gpio_drive;
141 priv->
base.sense = nv50_gpio_sense;
165 nv_wr32(priv, 0xe050, 0x00000000);
166 nv_wr32(priv, 0xe054, 0xffffffff);
167 if (nv_device(priv)->
chipset >= 0x90) {
168 nv_wr32(priv, 0xe070, 0x00000000);
169 nv_wr32(priv, 0xe074, 0xffffffff);
179 nv_wr32(priv, 0xe050, 0x00000000);
180 if (nv_device(priv)->
chipset >= 0x90)
181 nv_wr32(priv, 0xe070, 0x00000000);
189 .ctor = nv50_gpio_ctor,