[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
This commit is contained in:
Oleksandr Tymoshenko 2016-12-21 01:38:44 +00:00
parent bbcd5f00d0
commit 8ad55e0482
2 changed files with 9 additions and 8 deletions

View file

@ -351,7 +351,7 @@ sdma_configure(int chn, struct sdma_conf *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);

View file

@ -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 {