@@ -70,6 +70,7 @@ EXPORT_PER_CPU_SYMBOL_GPL(uv_cpu_nmi);
70
70
/* UV hubless values */
71
71
#define NMI_CONTROL_PORT 0x70
72
72
#define NMI_DUMMY_PORT 0x71
73
+ #define PAD_OWN_GPP_D_0 0x2c
73
74
#define GPI_NMI_STS_GPP_D_0 0x164
74
75
#define GPI_NMI_ENA_GPP_D_0 0x174
75
76
#define STS_GPP_D_0_MASK 0x1
@@ -160,6 +161,9 @@ static bool uv_pch_intr_enable = true;
160
161
static bool uv_pch_intr_now_enabled ;
161
162
module_param_named (pch_intr_enable , uv_pch_intr_enable , bool , 0644 );
162
163
164
+ static bool uv_pch_init_enable = true;
165
+ module_param_named (pch_init_enable , uv_pch_init_enable , bool , 0644 );
166
+
163
167
static int uv_nmi_debug ;
164
168
module_param_named (debug , uv_nmi_debug , int , 0644 );
165
169
@@ -307,6 +311,127 @@ static void uv_nmi_setup_hubless_intr(void)
307
311
uv_pch_intr_now_enabled ? "enabled" : "disabled" );
308
312
}
309
313
314
+ static struct init_nmi {
315
+ unsigned int offset ;
316
+ unsigned int mask ;
317
+ unsigned int data ;
318
+ } init_nmi [] = {
319
+ { /* HOSTSW_OWN_GPP_D_0 */
320
+ .offset = 0x84 ,
321
+ .mask = 0x1 ,
322
+ .data = 0x0 , /* ACPI Mode */
323
+ },
324
+
325
+ /* clear status */
326
+ { /* GPI_INT_STS_GPP_D_0 */
327
+ .offset = 0x104 ,
328
+ .mask = 0x0 ,
329
+ .data = 0x1 , /* Clear Status */
330
+ },
331
+ { /* GPI_GPE_STS_GPP_D_0 */
332
+ .offset = 0x124 ,
333
+ .mask = 0x0 ,
334
+ .data = 0x1 , /* Clear Status */
335
+ },
336
+ { /* GPI_SMI_STS_GPP_D_0 */
337
+ .offset = 0x144 ,
338
+ .mask = 0x0 ,
339
+ .data = 0x1 , /* Clear Status */
340
+ },
341
+ { /* GPI_NMI_STS_GPP_D_0 */
342
+ .offset = 0x164 ,
343
+ .mask = 0x0 ,
344
+ .data = 0x1 , /* Clear Status */
345
+ },
346
+
347
+ /* disable interrupts */
348
+ { /* GPI_INT_EN_GPP_D_0 */
349
+ .offset = 0x114 ,
350
+ .mask = 0x1 ,
351
+ .data = 0x0 , /* disable interrupt generation */
352
+ },
353
+ { /* GPI_GPE_EN_GPP_D_0 */
354
+ .offset = 0x134 ,
355
+ .mask = 0x1 ,
356
+ .data = 0x0 , /* disable interrupt generation */
357
+ },
358
+ { /* GPI_SMI_EN_GPP_D_0 */
359
+ .offset = 0x154 ,
360
+ .mask = 0x1 ,
361
+ .data = 0x0 , /* disable interrupt generation */
362
+ },
363
+ { /* GPI_NMI_EN_GPP_D_0 */
364
+ .offset = 0x174 ,
365
+ .mask = 0x1 ,
366
+ .data = 0x0 , /* disable interrupt generation */
367
+ },
368
+
369
+ /* setup GPP_D_0 Pad Config */
370
+ { /* PAD_CFG_DW0_GPP_D_0 */
371
+ .offset = 0x4c0 ,
372
+ .mask = 0xffffffff ,
373
+ .data = 0x82020100 ,
374
+ /*
375
+ * 31:30 Pad Reset Config (PADRSTCFG): = 2h # PLTRST# (default)
376
+ *
377
+ * 29 RX Pad State Select (RXPADSTSEL): = 0 # Raw RX pad state directly
378
+ * from RX buffer (default)
379
+ *
380
+ * 28 RX Raw Override to '1' (RXRAW1): = 0 # No Override
381
+ *
382
+ * 26:25 RX Level/Edge Configuration (RXEVCFG):
383
+ * = 0h # Level
384
+ * = 1h # Edge
385
+ *
386
+ * 23 RX Invert (RXINV): = 0 # No Inversion (signal active high)
387
+ *
388
+ * 20 GPIO Input Route IOxAPIC (GPIROUTIOXAPIC):
389
+ * = 0 # Routing does not cause peripheral IRQ...
390
+ * # (we want an NMI not an IRQ)
391
+ *
392
+ * 19 GPIO Input Route SCI (GPIROUTSCI): = 0 # Routing does not cause SCI.
393
+ * 18 GPIO Input Route SMI (GPIROUTSMI): = 0 # Routing does not cause SMI.
394
+ * 17 GPIO Input Route NMI (GPIROUTNMI): = 1 # Routing can cause NMI.
395
+ *
396
+ * 11:10 Pad Mode (PMODE1/0): = 0h = GPIO control the Pad.
397
+ * 9 GPIO RX Disable (GPIORXDIS):
398
+ * = 0 # Enable the input buffer (active low enable)
399
+ *
400
+ * 8 GPIO TX Disable (GPIOTXDIS):
401
+ * = 1 # Disable the output buffer; i.e. Hi-Z
402
+ *
403
+ * 1 GPIO RX State (GPIORXSTATE): This is the current internal RX pad state..
404
+ * 0 GPIO TX State (GPIOTXSTATE):
405
+ * = 0 # (Leave at default)
406
+ */
407
+ },
408
+
409
+ /* Pad Config DW1 */
410
+ { /* PAD_CFG_DW1_GPP_D_0 */
411
+ .offset = 0x4c4 ,
412
+ .mask = 0x3c00 ,
413
+ .data = 0 , /* Termination = none (default) */
414
+ },
415
+ };
416
+
417
+ static void uv_init_hubless_pch_d0 (void )
418
+ {
419
+ int i , read ;
420
+
421
+ read = * PCH_PCR_GPIO_ADDRESS (PAD_OWN_GPP_D_0 );
422
+ if (read != 0 ) {
423
+ pr_info ("UV: Hubless NMI already configured\n" );
424
+ return ;
425
+ }
426
+
427
+ nmi_debug ("UV: Initializing UV Hubless NMI on PCH\n" );
428
+ for (i = 0 ; i < ARRAY_SIZE (init_nmi ); i ++ ) {
429
+ uv_init_hubless_pch_io (init_nmi [i ].offset ,
430
+ init_nmi [i ].mask ,
431
+ init_nmi [i ].data );
432
+ }
433
+ }
434
+
310
435
static int uv_nmi_test_hubless (struct uv_hub_nmi_s * hub_nmi )
311
436
{
312
437
int * pstat = PCH_PCR_GPIO_ADDRESS (GPI_NMI_STS_GPP_D_0 );
@@ -929,6 +1054,8 @@ void __init uv_nmi_setup_hubless(void)
929
1054
pch_base = xlate_dev_mem_ptr (PCH_PCR_GPIO_1_BASE );
930
1055
nmi_debug ("UV: PCH base:%p from 0x%lx, GPP_D_0\n" ,
931
1056
pch_base , PCH_PCR_GPIO_1_BASE );
1057
+ if (uv_pch_init_enable )
1058
+ uv_init_hubless_pch_d0 ();
932
1059
uv_init_hubless_pch_io (GPI_NMI_ENA_GPP_D_0 ,
933
1060
STS_GPP_D_0_MASK , STS_GPP_D_0_MASK );
934
1061
uv_nmi_setup_hubless_intr ();
0 commit comments