Lines Matching +full:ls1028a +full:- +full:reset
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
177 {"fsl,ls1021a-ahci", QORIQ_AHCI_LS1021A},
178 {"fsl,ls1028a-ahci", QORIQ_AHCI_LS1028A},
179 {"fsl,ls1043a-ahci", QORIQ_AHCI_LS1043A},
180 {"fsl,ls2080a-ahci", QORIQ_AHCI_LS2080A},
181 {"fsl,ls1046a-ahci", QORIQ_AHCI_LS1046A},
182 {"fsl,ls1088a-ahci", QORIQ_AHCI_LS1088A},
183 {"fsl,ls2088a-ahci", QORIQ_AHCI_LS2088A},
184 {"fsl,lx2160a-ahci", QORIQ_AHCI_LX2160A},
195 switch (ctrl->soc_type) { in ahci_fsl_fdt_ecc_init()
201 if (!ecc_inited && ctrl->r_ecc == NULL) in ahci_fsl_fdt_ecc_init()
204 ATA_OUTL(ctrl->r_ecc, AHCI_FSL_REG_ECC, in ahci_fsl_fdt_ecc_init()
210 if (!ecc_inited && ctrl->r_ecc == NULL) in ahci_fsl_fdt_ecc_init()
213 val = ATA_INL(ctrl->r_ecc, AHCI_FSL_REG_ECC); in ahci_fsl_fdt_ecc_init()
215 ATA_OUTL(ctrl->r_ecc, AHCI_FSL_REG_ECC, val); in ahci_fsl_fdt_ecc_init()
222 if (!ecc_inited && ctrl->r_ecc == NULL) in ahci_fsl_fdt_ecc_init()
226 val = ATA_INL(ctrl->r_ecc, AHCI_FSL_REG_ECC); in ahci_fsl_fdt_ecc_init()
228 ATA_OUTL(ctrl->r_ecc, AHCI_FSL_REG_ECC, val); in ahci_fsl_fdt_ecc_init()
233 panic("Unimplemented SOC type: %d", ctrl->soc_type); in ahci_fsl_fdt_ecc_init()
245 ahci = &ctrl->ctlr; in ahci_fsl_fdt_phy_init()
246 if (ctrl->soc_type == QORIQ_AHCI_LS1021A) { in ahci_fsl_fdt_phy_init()
247 ATA_OUTL(ahci->r_mem, AHCI_FSL_REG_PHY1, in ahci_fsl_fdt_phy_init()
249 ATA_OUTL(ahci->r_mem, AHCI_FSL_REG_PHY2, in ahci_fsl_fdt_phy_init()
251 ATA_OUTL(ahci->r_mem, AHCI_FSL_REG_PHY3, in ahci_fsl_fdt_phy_init()
253 ATA_OUTL(ahci->r_mem, AHCI_FSL_REG_PHY4, in ahci_fsl_fdt_phy_init()
255 ATA_OUTL(ahci->r_mem, AHCI_FSL_REG_PHY5, in ahci_fsl_fdt_phy_init()
257 ATA_OUTL(ahci->r_mem, AHCI_FSL_REG_PTC, in ahci_fsl_fdt_phy_init()
260 if (ctrl->ctlr.dma_coherent) in ahci_fsl_fdt_phy_init()
261 ATA_OUTL(ahci->r_mem, AHCI_FSL_LS1021A_AXICC, in ahci_fsl_fdt_phy_init()
264 ATA_OUTL(ahci->r_mem, AHCI_FSL_REG_PHY1, in ahci_fsl_fdt_phy_init()
266 ATA_OUTL(ahci->r_mem, AHCI_FSL_REG_PHY2, in ahci_fsl_fdt_phy_init()
268 ATA_OUTL(ahci->r_mem, AHCI_FSL_REG_PHY3, in ahci_fsl_fdt_phy_init()
270 ATA_OUTL(ahci->r_mem, AHCI_FSL_REG_PTC, in ahci_fsl_fdt_phy_init()
273 if (ctrl->ctlr.dma_coherent) in ahci_fsl_fdt_phy_init()
274 ATA_OUTL(ahci->r_mem, AHCI_FSL_REG_AXICC, in ahci_fsl_fdt_phy_init()
285 if (!ofw_bus_search_compatible(dev, ahci_fsl_fdt_compat_data)->ocd_data) in ahci_fsl_fdt_probe()
303 ctlr->soc_type = in ahci_fsl_fdt_attach()
304 ofw_bus_search_compatible(dev, ahci_fsl_fdt_compat_data)->ocd_data; in ahci_fsl_fdt_attach()
305 ahci = &ctlr->ctlr; in ahci_fsl_fdt_attach()
306 ahci->dev = dev; in ahci_fsl_fdt_attach()
307 ahci->r_rid = 0; in ahci_fsl_fdt_attach()
308 ahci->quirks = AHCI_Q_NOPMP; in ahci_fsl_fdt_attach()
310 ahci->dma_coherent = OF_hasprop(node, "dma-coherent"); in ahci_fsl_fdt_attach()
324 if (OF_hasprop(node, "reg-names") && ofw_bus_find_string_index(node, in ahci_fsl_fdt_attach()
325 "reg-names", "ahci", &ahci->r_rid)) { in ahci_fsl_fdt_attach()
327 "'reg-names' property"); in ahci_fsl_fdt_attach()
331 ahci->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, in ahci_fsl_fdt_attach()
332 &ahci->r_rid, RF_ACTIVE); in ahci_fsl_fdt_attach()
333 if (!ahci->r_mem) { in ahci_fsl_fdt_attach()
339 ret = ofw_bus_find_string_index(node, "reg-names", "sata-ecc", in ahci_fsl_fdt_attach()
340 &ctlr->r_ecc_rid); in ahci_fsl_fdt_attach()
342 ctlr->r_ecc = bus_alloc_resource_any(dev, SYS_RES_MEMORY, in ahci_fsl_fdt_attach()
343 &ctlr->r_ecc_rid, RF_ACTIVE| RF_SHAREABLE); in ahci_fsl_fdt_attach()
344 if (!ctlr->r_ecc) { in ahci_fsl_fdt_attach()
351 device_printf(dev, "Could not locate 'sata-ecc' string in " in ahci_fsl_fdt_attach()
352 "the 'reg-names' property"); in ahci_fsl_fdt_attach()
363 ahci->numirqs = 1; in ahci_fsl_fdt_attach()
366 /* Reset controller. */ in ahci_fsl_fdt_attach()
380 bus_free_resource(dev, SYS_RES_MEMORY, ahci->r_mem); in ahci_fsl_fdt_attach()
382 if (ctlr->r_ecc) in ahci_fsl_fdt_attach()
383 bus_free_resource(dev, SYS_RES_MEMORY, ctlr->r_ecc); in ahci_fsl_fdt_attach()
393 if (ctlr->r_ecc) in ahci_fsl_fdt_detach()
394 bus_free_resource(dev, SYS_RES_MEMORY, ctlr->r_ecc); in ahci_fsl_fdt_detach()