Author: gonzo Date: Wed Dec 21 01:38:44 2016 New Revision: 310344 URL: https://svnweb.freebsd.org/changeset/base/310344
Log: [iMX6] Fix SDMA driver build - Place const modifiers where required - Make sure sdma device is attahched before consumers like SSI Reviewed by: br MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8874 Modified: head/sys/arm/freescale/imx/imx6_sdma.c head/sys/arm/freescale/imx/imx6_sdma.h Modified: head/sys/arm/freescale/imx/imx6_sdma.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_sdma.c Wed Dec 21 01:32:19 2016 (r310343) +++ head/sys/arm/freescale/imx/imx6_sdma.c Wed Dec 21 01:38:44 2016 (r310344) @@ -351,7 +351,7 @@ sdma_configure(int chn, struct sdma_conf static int load_firmware(struct sdma_softc *sc) { - struct sdma_firmware_header *header; + const struct sdma_firmware_header *header; const struct firmware *fp; fp = firmware_get("sdma_fw"); @@ -360,14 +360,14 @@ load_firmware(struct sdma_softc *sc) return (-1); } - header = (struct sdma_firmware_header *)fp->data; + header = fp->data; if (header->magic != FW_HEADER_MAGIC) { device_printf(sc->dev, "Can't use firmware.\n"); return (-1); } sc->fw_header = header; - sc->fw_scripts = (void *)((char *)header + + sc->fw_scripts = (const void *)((const char *)header + header->script_addrs_start); return (0); @@ -377,14 +377,14 @@ static int boot_firmware(struct sdma_softc *sc) { struct sdma_buffer_descriptor *bd0; - uint32_t *ram_code; + const uint32_t *ram_code; int timeout; int ret; int chn; int sz; int i; - ram_code = (void *)((char *)sc->fw_header + + ram_code = (const void *)((const char *)sc->fw_header + sc->fw_header->ram_code_start); /* Make sure SDMA has not started yet */ @@ -514,4 +514,5 @@ static driver_t sdma_driver = { static devclass_t sdma_devclass; -DRIVER_MODULE(sdma, simplebus, sdma_driver, sdma_devclass, 0, 0); +EARLY_DRIVER_MODULE(sdma, simplebus, sdma_driver, sdma_devclass, 0, 0, + BUS_PASS_RESOURCE); Modified: head/sys/arm/freescale/imx/imx6_sdma.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_sdma.h Wed Dec 21 01:32:19 2016 (r310343) +++ head/sys/arm/freescale/imx/imx6_sdma.h Wed Dec 21 01:38:44 2016 (r310344) @@ -221,8 +221,8 @@ struct sdma_softc { uint32_t num_bd; uint32_t ccb_phys; uint32_t context_phys; - struct sdma_firmware_header *fw_header; - struct sdma_script_start_addrs *fw_scripts; + const struct sdma_firmware_header *fw_header; + const struct sdma_script_start_addrs *fw_scripts; }; struct sdma_conf { _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"