2 * Sonics Silicon Backplane
3 * Broadcom PCI-core driver
5 * Copyright 2005, Broadcom Corporation
6 * Copyright 2006, 2007, Michael Buesch <mb@bu3sch.de>
8 * Licensed under the GNU/GPL. See COPYING for details.
11 #include <linux/ssb/ssb.h>
12 #include <linux/pci.h>
13 #include <linux/delay.h>
14 <<<<<<< HEAD
:drivers
/ssb
/driver_pcicore
.c
16 #include <linux/ssb/ssb_embedded.h>
17 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/ssb
/driver_pcicore
.c
19 #include "ssb_private.h"
23 u32
pcicore_read32(struct ssb_pcicore
*pc
, u16 offset
)
25 return ssb_read32(pc
->dev
, offset
);
29 void pcicore_write32(struct ssb_pcicore
*pc
, u16 offset
, u32 value
)
31 ssb_write32(pc
->dev
, offset
, value
);
34 <<<<<<< HEAD
:drivers
/ssb
/driver_pcicore
.c
37 u16
pcicore_read16(struct ssb_pcicore
*pc
, u16 offset
)
39 return ssb_read16(pc
->dev
, offset
);
43 void pcicore_write16(struct ssb_pcicore
*pc
, u16 offset
, u16 value
)
45 ssb_write16(pc
->dev
, offset
, value
);
48 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/ssb
/driver_pcicore
.c
49 /**************************************************
50 * Code for hostmode operation.
51 **************************************************/
53 #ifdef CONFIG_SSB_PCICORE_HOSTMODE
55 #include <asm/paccess.h>
56 /* Probe a 32bit value on the bus and catch bus exceptions.
57 * Returns nonzero on a bus exception.
58 * This is MIPS specific */
59 #define mips_busprobe32(val, addr) get_dbe((val), ((u32 *)(addr)))
61 /* Assume one-hot slot wiring */
62 #define SSB_PCI_SLOT_MAX 16
64 /* Global lock is OK, as we won't have more than one extpci anyway. */
65 static DEFINE_SPINLOCK(cfgspace_lock
);
66 /* Core to access the external PCI config space. Can only have one. */
67 static struct ssb_pcicore
*extpci_core
;
69 static u32 ssb_pcicore_pcibus_iobase
= 0x100;
70 static u32 ssb_pcicore_pcibus_membase
= SSB_PCI_DMA
;
72 int pcibios_plat_dev_init(struct pci_dev
*d
)
78 ssb_printk(KERN_INFO
"PCI: Fixing up device %s\n",
81 /* Fix up resource bases */
82 for (pos
= 0; pos
< 6; pos
++) {
83 res
= &d
->resource
[pos
];
84 if (res
->flags
& IORESOURCE_IO
)
85 base
= &ssb_pcicore_pcibus_iobase
;
87 base
= &ssb_pcicore_pcibus_membase
;
88 <<<<<<< HEAD
:drivers
/ssb
/driver_pcicore
.c
90 res
->flags
|= IORESOURCE_PCI_FIXED
;
91 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/ssb
/driver_pcicore
.c
93 size
= res
->end
- res
->start
+ 1;
94 if (*base
& (size
- 1))
95 *base
= (*base
+ size
) & ~(size
- 1);
97 res
->end
= res
->start
+ size
- 1;
99 pci_write_config_dword(d
, PCI_BASE_ADDRESS_0
+ (pos
<< 2), res
->start
);
101 /* Fix up PCI bridge BAR0 only */
102 if (d
->bus
->number
== 0 && PCI_SLOT(d
->devfn
) == 0)
105 /* Fix up interrupt lines */
106 d
->irq
= ssb_mips_irq(extpci_core
->dev
) + 2;
107 pci_write_config_byte(d
, PCI_INTERRUPT_LINE
, d
->irq
);
112 static void __init
ssb_fixup_pcibridge(struct pci_dev
*dev
)
114 <<<<<<< HEAD
:drivers
/ssb
/driver_pcicore
.c
118 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/ssb
/driver_pcicore
.c
119 if (dev
->bus
->number
!= 0 || PCI_SLOT(dev
->devfn
) != 0)
122 <<<<<<< HEAD
:drivers
/ssb
/driver_pcicore
.c
123 ssb_printk(KERN_INFO
"PCI: fixing up bridge\n");
125 ssb_printk(KERN_INFO
"PCI: Fixing up bridge %s\n", pci_name(dev
));
126 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/ssb
/driver_pcicore
.c
128 /* Enable PCI bridge bus mastering and memory space */
130 <<<<<<< HEAD
:drivers
/ssb
/driver_pcicore
.c
131 pcibios_enable_device(dev
, ~0);
133 if (pcibios_enable_device(dev
, ~0) < 0) {
134 ssb_printk(KERN_ERR
"PCI: SSB bridge enable failed\n");
137 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/ssb
/driver_pcicore
.c
139 /* Enable PCI bridge BAR1 prefetch and burst */
140 pci_write_config_dword(dev
, SSB_BAR1_CONTROL
, 3);
142 /* Make sure our latency is high enough to handle the devices behind us */
143 <<<<<<< HEAD
:drivers
/ssb
/driver_pcicore
.c
144 pci_write_config_byte(dev
, PCI_LATENCY_TIMER
, 0xa8);
147 ssb_printk(KERN_INFO
"PCI: Fixing latency timer of device %s to %u\n",
149 pci_write_config_byte(dev
, PCI_LATENCY_TIMER
, lat
);
150 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/ssb
/driver_pcicore
.c
152 DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID
, PCI_ANY_ID
, ssb_fixup_pcibridge
);
154 int __init
pcibios_map_irq(const struct pci_dev
*dev
, u8 slot
, u8 pin
)
156 return ssb_mips_irq(extpci_core
->dev
) + 2;
159 static u32
get_cfgspace_addr(struct ssb_pcicore
*pc
,
160 unsigned int bus
, unsigned int dev
,
161 unsigned int func
, unsigned int off
)
166 <<<<<<< HEAD
:drivers
/ssb
/driver_pcicore
.c
167 if (unlikely(pc
->cardbusmode
&& dev
> 1))
169 /* We do only have one cardbus device behind the bridge. */
170 if (pc
->cardbusmode
&& (dev
>= 1))
171 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/ssb
/driver_pcicore
.c
173 <<<<<<< HEAD
:drivers
/ssb
/driver_pcicore
.c
176 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/ssb
/driver_pcicore
.c
178 /* Type 0 transaction */
179 if (unlikely(dev
>= SSB_PCI_SLOT_MAX
))
181 /* Slide the window */
182 tmp
= SSB_PCICORE_SBTOPCI_CFG0
;
183 tmp
|= ((1 << (dev
+ 16)) & SSB_PCICORE_SBTOPCI1_MASK
);
184 pcicore_write32(pc
, SSB_PCICORE_SBTOPCI1
, tmp
);
185 /* Calculate the address */
187 addr
|= ((1 << (dev
+ 16)) & ~SSB_PCICORE_SBTOPCI1_MASK
);
191 /* Type 1 transaction */
192 pcicore_write32(pc
, SSB_PCICORE_SBTOPCI1
,
193 SSB_PCICORE_SBTOPCI_CFG1
);
194 /* Calculate the address */
205 static int ssb_extpci_read_config(struct ssb_pcicore
*pc
,
206 unsigned int bus
, unsigned int dev
,
207 unsigned int func
, unsigned int off
,
214 SSB_WARN_ON(!pc
->hostmode
);
215 if (unlikely(len
!= 1 && len
!= 2 && len
!= 4))
217 addr
= get_cfgspace_addr(pc
, bus
, dev
, func
, off
);
221 mmio
= ioremap_nocache(addr
, len
);
225 if (mips_busprobe32(val
, mmio
)) {
231 val
>>= (8 * (off
& 3));
235 *((u8
*)buf
) = (u8
)val
;
238 *((u16
*)buf
) = (u16
)val
;
241 *((u32
*)buf
) = (u32
)val
;
251 static int ssb_extpci_write_config(struct ssb_pcicore
*pc
,
252 unsigned int bus
, unsigned int dev
,
253 unsigned int func
, unsigned int off
,
254 const void *buf
, int len
)
260 SSB_WARN_ON(!pc
->hostmode
);
261 if (unlikely(len
!= 1 && len
!= 2 && len
!= 4))
263 addr
= get_cfgspace_addr(pc
, bus
, dev
, func
, off
);
267 mmio
= ioremap_nocache(addr
, len
);
271 if (mips_busprobe32(val
, mmio
)) {
279 val
&= ~(0xFF << (8 * (off
& 3)));
280 val
|= *((const u8
*)buf
) << (8 * (off
& 3));
284 val
&= ~(0xFFFF << (8 * (off
& 3)));
285 val
|= *((const u16
*)buf
) << (8 * (off
& 3));
288 val
= *((const u32
*)buf
);
300 static int ssb_pcicore_read_config(struct pci_bus
*bus
, unsigned int devfn
,
301 int reg
, int size
, u32
*val
)
306 spin_lock_irqsave(&cfgspace_lock
, flags
);
307 err
= ssb_extpci_read_config(extpci_core
, bus
->number
, PCI_SLOT(devfn
),
308 PCI_FUNC(devfn
), reg
, val
, size
);
309 spin_unlock_irqrestore(&cfgspace_lock
, flags
);
311 return err
? PCIBIOS_DEVICE_NOT_FOUND
: PCIBIOS_SUCCESSFUL
;
314 static int ssb_pcicore_write_config(struct pci_bus
*bus
, unsigned int devfn
,
315 int reg
, int size
, u32 val
)
320 spin_lock_irqsave(&cfgspace_lock
, flags
);
321 err
= ssb_extpci_write_config(extpci_core
, bus
->number
, PCI_SLOT(devfn
),
322 PCI_FUNC(devfn
), reg
, &val
, size
);
323 spin_unlock_irqrestore(&cfgspace_lock
, flags
);
325 return err
? PCIBIOS_DEVICE_NOT_FOUND
: PCIBIOS_SUCCESSFUL
;
328 static struct pci_ops ssb_pcicore_pciops
= {
329 .read
= ssb_pcicore_read_config
,
330 .write
= ssb_pcicore_write_config
,
333 static struct resource ssb_pcicore_mem_resource
= {
334 .name
= "SSB PCIcore external memory",
335 .start
= SSB_PCI_DMA
,
336 .end
= SSB_PCI_DMA
+ SSB_PCI_DMA_SZ
- 1,
337 <<<<<<< HEAD
:drivers
/ssb
/driver_pcicore
.c
338 .flags
= IORESOURCE_MEM
,
340 .flags
= IORESOURCE_MEM
| IORESOURCE_PCI_FIXED
,
341 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/ssb
/driver_pcicore
.c
344 static struct resource ssb_pcicore_io_resource
= {
345 .name
= "SSB PCIcore external I/O",
348 <<<<<<< HEAD
:drivers
/ssb
/driver_pcicore
.c
349 .flags
= IORESOURCE_IO
,
351 .flags
= IORESOURCE_IO
| IORESOURCE_PCI_FIXED
,
352 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/ssb
/driver_pcicore
.c
355 static struct pci_controller ssb_pcicore_controller
= {
356 .pci_ops
= &ssb_pcicore_pciops
,
357 .io_resource
= &ssb_pcicore_io_resource
,
358 .mem_resource
= &ssb_pcicore_mem_resource
,
359 .mem_offset
= 0x24000000,
362 static void ssb_pcicore_init_hostmode(struct ssb_pcicore
*pc
)
366 if (WARN_ON(extpci_core
))
370 ssb_dprintk(KERN_INFO PFX
"PCIcore in host mode found\n");
371 /* Reset devices on the external PCI bus */
372 val
= SSB_PCICORE_CTL_RST_OE
;
373 val
|= SSB_PCICORE_CTL_CLK_OE
;
374 pcicore_write32(pc
, SSB_PCICORE_CTL
, val
);
375 val
|= SSB_PCICORE_CTL_CLK
; /* Clock on */
376 pcicore_write32(pc
, SSB_PCICORE_CTL
, val
);
377 udelay(150); /* Assertion time demanded by the PCI standard */
378 val
|= SSB_PCICORE_CTL_RST
; /* Deassert RST# */
379 pcicore_write32(pc
, SSB_PCICORE_CTL
, val
);
380 val
= SSB_PCICORE_ARBCTL_INTERN
;
381 pcicore_write32(pc
, SSB_PCICORE_ARBCTL
, val
);
382 udelay(1); /* Assertion time demanded by the PCI standard */
384 <<<<<<< HEAD
:drivers
/ssb
/driver_pcicore
.c
385 /*TODO cardbus mode */
387 if (pc
->dev
->bus
->has_cardbus_slot
) {
388 ssb_dprintk(KERN_INFO PFX
"CardBus slot detected\n");
390 /* GPIO 1 resets the bridge */
391 ssb_gpio_out(pc
->dev
->bus
, 1, 1);
392 ssb_gpio_outen(pc
->dev
->bus
, 1, 1);
393 pcicore_write16(pc
, SSB_PCICORE_SPROM(0),
394 pcicore_read16(pc
, SSB_PCICORE_SPROM(0))
397 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/ssb
/driver_pcicore
.c
399 /* 64MB I/O window */
400 pcicore_write32(pc
, SSB_PCICORE_SBTOPCI0
,
401 SSB_PCICORE_SBTOPCI_IO
);
402 /* 64MB config space */
403 pcicore_write32(pc
, SSB_PCICORE_SBTOPCI1
,
404 SSB_PCICORE_SBTOPCI_CFG0
);
405 /* 1GB memory window */
406 pcicore_write32(pc
, SSB_PCICORE_SBTOPCI2
,
407 SSB_PCICORE_SBTOPCI_MEM
| SSB_PCI_DMA
);
409 /* Enable PCI bridge BAR0 prefetch and burst */
410 val
= PCI_COMMAND_MASTER
| PCI_COMMAND_MEMORY
;
411 ssb_extpci_write_config(pc
, 0, 0, 0, PCI_COMMAND
, &val
, 2);
412 /* Clear error conditions */
414 ssb_extpci_write_config(pc
, 0, 0, 0, PCI_STATUS
, &val
, 2);
416 /* Enable PCI interrupts */
417 pcicore_write32(pc
, SSB_PCICORE_IMASK
,
418 SSB_PCICORE_IMASK_INTA
);
420 /* Ok, ready to run, register it to the system.
421 * The following needs change, if we want to port hostmode
422 * to non-MIPS platform. */
423 <<<<<<< HEAD
:drivers
/ssb
/driver_pcicore
.c
424 set_io_port_base((unsigned long)ioremap_nocache(SSB_PCI_MEM
, 0x04000000));
426 ssb_pcicore_controller
.io_map_base
= (unsigned long)ioremap_nocache(SSB_PCI_MEM
, 0x04000000);
427 set_io_port_base(ssb_pcicore_controller
.io_map_base
);
428 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/ssb
/driver_pcicore
.c
429 /* Give some time to the PCI controller to configure itself with the new
430 * values. Not waiting at this point causes crashes of the machine. */
432 register_pci_controller(&ssb_pcicore_controller
);
435 static int pcicore_is_in_hostmode(struct ssb_pcicore
*pc
)
437 struct ssb_bus
*bus
= pc
->dev
->bus
;
441 chipid_top
= (bus
->chip_id
& 0xFF00);
442 if (chipid_top
!= 0x4700 &&
443 chipid_top
!= 0x5300)
446 <<<<<<< HEAD
:drivers
/ssb
/driver_pcicore
.c
447 if (bus
->sprom
.r1
.boardflags_lo
& SSB_PCICORE_BFL_NOPCI
)
449 if (bus
->sprom
.boardflags_lo
& SSB_PCICORE_BFL_NOPCI
)
450 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/ssb
/driver_pcicore
.c
453 /* The 200-pin BCM4712 package does not bond out PCI. Even when
454 * PCI is bonded out, some boards may leave the pins floating. */
455 if (bus
->chip_id
== 0x4712) {
456 if (bus
->chip_package
== SSB_CHIPPACK_BCM4712S
)
458 if (bus
->chip_package
== SSB_CHIPPACK_BCM4712M
)
461 if (bus
->chip_id
== 0x5350)
464 return !mips_busprobe32(tmp
, (bus
->mmio
+ (pc
->dev
->core_index
* SSB_CORE_SIZE
)));
466 #endif /* CONFIG_SSB_PCICORE_HOSTMODE */
469 /**************************************************
470 * Generic and Clientmode operation code.
471 **************************************************/
473 static void ssb_pcicore_init_clientmode(struct ssb_pcicore
*pc
)
475 /* Disable PCI interrupts. */
476 ssb_write32(pc
->dev
, SSB_INTVEC
, 0);
479 void ssb_pcicore_init(struct ssb_pcicore
*pc
)
481 struct ssb_device
*dev
= pc
->dev
;
487 if (!ssb_device_is_enabled(dev
))
488 ssb_device_enable(dev
, 0);
490 #ifdef CONFIG_SSB_PCICORE_HOSTMODE
491 pc
->hostmode
= pcicore_is_in_hostmode(pc
);
493 ssb_pcicore_init_hostmode(pc
);
494 #endif /* CONFIG_SSB_PCICORE_HOSTMODE */
496 ssb_pcicore_init_clientmode(pc
);
499 static u32
ssb_pcie_read(struct ssb_pcicore
*pc
, u32 address
)
501 pcicore_write32(pc
, 0x130, address
);
502 return pcicore_read32(pc
, 0x134);
505 static void ssb_pcie_write(struct ssb_pcicore
*pc
, u32 address
, u32 data
)
507 pcicore_write32(pc
, 0x130, address
);
508 pcicore_write32(pc
, 0x134, data
);
511 static void ssb_pcie_mdio_write(struct ssb_pcicore
*pc
, u8 device
,
512 u8 address
, u16 data
)
514 const u16 mdio_control
= 0x128;
515 const u16 mdio_data
= 0x12C;
519 v
= 0x80; /* Enable Preamble Sequence */
520 v
|= 0x2; /* MDIO Clock Divisor */
521 pcicore_write32(pc
, mdio_control
, v
);
523 v
= (1 << 30); /* Start of Transaction */
524 v
|= (1 << 28); /* Write Transaction */
525 v
|= (1 << 17); /* Turnaround */
526 v
|= (u32
)device
<< 22;
527 v
|= (u32
)address
<< 18;
529 pcicore_write32(pc
, mdio_data
, v
);
530 /* Wait for the device to complete the transaction */
532 for (i
= 0; i
< 10; i
++) {
533 v
= pcicore_read32(pc
, mdio_control
);
534 if (v
& 0x100 /* Trans complete */)
538 pcicore_write32(pc
, mdio_control
, 0);
541 static void ssb_broadcast_value(struct ssb_device
*dev
,
542 u32 address
, u32 data
)
544 /* This is used for both, PCI and ChipCommon core, so be careful. */
545 BUILD_BUG_ON(SSB_PCICORE_BCAST_ADDR
!= SSB_CHIPCO_BCAST_ADDR
);
546 BUILD_BUG_ON(SSB_PCICORE_BCAST_DATA
!= SSB_CHIPCO_BCAST_DATA
);
548 ssb_write32(dev
, SSB_PCICORE_BCAST_ADDR
, address
);
549 ssb_read32(dev
, SSB_PCICORE_BCAST_ADDR
); /* flush */
550 ssb_write32(dev
, SSB_PCICORE_BCAST_DATA
, data
);
551 ssb_read32(dev
, SSB_PCICORE_BCAST_DATA
); /* flush */
554 static void ssb_commit_settings(struct ssb_bus
*bus
)
556 struct ssb_device
*dev
;
558 dev
= bus
->chipco
.dev
? bus
->chipco
.dev
: bus
->pcicore
.dev
;
561 /* This forces an update of the cached registers. */
562 ssb_broadcast_value(dev
, 0xFD8, 0);
565 int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore
*pc
,
566 struct ssb_device
*dev
)
568 struct ssb_device
*pdev
= pc
->dev
;
579 /* Enable interrupts for this device. */
581 ((pdev
->id
.revision
>= 6) || (pdev
->id
.coreid
== SSB_DEV_PCIE
))) {
584 /* Calculate the "coremask" for the device. */
585 coremask
= (1 << dev
->core_index
);
587 err
= pci_read_config_dword(bus
->host_pci
, SSB_PCI_IRQMASK
, &tmp
);
590 tmp
|= coremask
<< 8;
591 err
= pci_write_config_dword(bus
->host_pci
, SSB_PCI_IRQMASK
, tmp
);
597 intvec
= ssb_read32(pdev
, SSB_INTVEC
);
598 if ((bus
->chip_id
& 0xFF00) == 0x4400) {
599 /* Workaround: On the BCM44XX the BPFLAG routing
600 * bit is wrong. Use a hardcoded constant. */
601 intvec
|= 0x00000002;
603 tmp
= ssb_read32(dev
, SSB_TPSFLAG
);
604 tmp
&= SSB_TPSFLAG_BPFLAG
;
607 ssb_write32(pdev
, SSB_INTVEC
, intvec
);
610 /* Setup PCIcore operation. */
613 if (pdev
->id
.coreid
== SSB_DEV_PCI
) {
614 tmp
= pcicore_read32(pc
, SSB_PCICORE_SBTOPCI2
);
615 tmp
|= SSB_PCICORE_SBTOPCI_PREF
;
616 tmp
|= SSB_PCICORE_SBTOPCI_BURST
;
617 pcicore_write32(pc
, SSB_PCICORE_SBTOPCI2
, tmp
);
619 if (pdev
->id
.revision
< 5) {
620 tmp
= ssb_read32(pdev
, SSB_IMCFGLO
);
621 tmp
&= ~SSB_IMCFGLO_SERTO
;
623 tmp
&= ~SSB_IMCFGLO_REQTO
;
624 tmp
|= 3 << SSB_IMCFGLO_REQTO_SHIFT
;
625 ssb_write32(pdev
, SSB_IMCFGLO
, tmp
);
626 ssb_commit_settings(bus
);
627 } else if (pdev
->id
.revision
>= 11) {
628 tmp
= pcicore_read32(pc
, SSB_PCICORE_SBTOPCI2
);
629 tmp
|= SSB_PCICORE_SBTOPCI_MRM
;
630 pcicore_write32(pc
, SSB_PCICORE_SBTOPCI2
, tmp
);
633 WARN_ON(pdev
->id
.coreid
!= SSB_DEV_PCIE
);
634 //TODO: Better make defines for all these magic PCIE values.
635 if ((pdev
->id
.revision
== 0) || (pdev
->id
.revision
== 1)) {
636 /* TLP Workaround register. */
637 tmp
= ssb_pcie_read(pc
, 0x4);
639 ssb_pcie_write(pc
, 0x4, tmp
);
641 if (pdev
->id
.revision
== 0) {
642 const u8 serdes_rx_device
= 0x1F;
644 ssb_pcie_mdio_write(pc
, serdes_rx_device
,
645 2 /* Timer */, 0x8128);
646 ssb_pcie_mdio_write(pc
, serdes_rx_device
,
647 6 /* CDR */, 0x0100);
648 ssb_pcie_mdio_write(pc
, serdes_rx_device
,
649 7 /* CDR BW */, 0x1466);
650 } else if (pdev
->id
.revision
== 1) {
651 /* DLLP Link Control register. */
652 tmp
= ssb_pcie_read(pc
, 0x100);
654 ssb_pcie_write(pc
, 0x100, tmp
);
661 EXPORT_SYMBOL(ssb_pcicore_dev_irqvecs_enable
);