diff options
Diffstat (limited to 'hw/misc')
-rw-r--r-- | hw/misc/Makefile.objs | 2 | ||||
-rw-r--r-- | hw/misc/auxbus.c (renamed from hw/misc/aux.c) | 16 | ||||
-rw-r--r-- | hw/misc/imx6_ccm.c | 6 |
3 files changed, 15 insertions, 9 deletions
diff --git a/hw/misc/Makefile.objs b/hw/misc/Makefile.objs index 54020aa06c..4cfbd1024a 100644 --- a/hw/misc/Makefile.objs +++ b/hw/misc/Makefile.objs @@ -51,5 +51,5 @@ obj-$(CONFIG_MIPS_ITU) += mips_itu.o obj-$(CONFIG_PVPANIC) += pvpanic.o obj-$(CONFIG_EDU) += edu.o obj-$(CONFIG_HYPERV_TESTDEV) += hyperv_testdev.o -obj-$(CONFIG_AUX) += aux.o +obj-$(CONFIG_AUX) += auxbus.o obj-$(CONFIG_ASPEED_SOC) += aspeed_scu.o diff --git a/hw/misc/aux.c b/hw/misc/auxbus.c index 25d7712398..e4a7ba41de 100644 --- a/hw/misc/aux.c +++ b/hw/misc/auxbus.c @@ -1,5 +1,5 @@ /* - * aux.c + * auxbus.c * * Copyright 2015 : GreenSocs Ltd * http://www.greensocs.com/ , email: info@greensocs.com @@ -28,7 +28,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" -#include "hw/misc/aux.h" +#include "hw/misc/auxbus.h" #include "hw/i2c/i2c.h" #include "monitor/monitor.h" @@ -153,12 +153,12 @@ AUXReply aux_request(AUXBus *bus, AUXCommand cmd, uint32_t address, case WRITE_I2C_MOT: case READ_I2C_MOT: is_write = cmd == READ_I2C_MOT ? false : true; + ret = AUX_I2C_NACK; if (!i2c_bus_busy(i2c_bus)) { /* * No transactions started.. */ if (i2c_start_transfer(i2c_bus, address, is_write)) { - ret = AUX_I2C_NACK; break; } } else if ((address != bus->last_i2c_address) || @@ -168,22 +168,22 @@ AUXReply aux_request(AUXBus *bus, AUXCommand cmd, uint32_t address, */ i2c_end_transfer(i2c_bus); if (i2c_start_transfer(i2c_bus, address, is_write)) { - ret = AUX_I2C_NACK; break; } } + bus->last_transaction = cmd; + bus->last_i2c_address = address; while (len > 0) { if (i2c_send_recv(i2c_bus, data++, is_write) < 0) { - ret = AUX_I2C_NACK; i2c_end_transfer(i2c_bus); break; } len--; } - bus->last_transaction = cmd; - bus->last_i2c_address = address; - ret = AUX_I2C_ACK; + if (len == 0) { + ret = AUX_I2C_ACK; + } break; default: DPRINTF("Not implemented!\n"); diff --git a/hw/misc/imx6_ccm.c b/hw/misc/imx6_ccm.c index ec58eef92d..17e15d4c92 100644 --- a/hw/misc/imx6_ccm.c +++ b/hw/misc/imx6_ccm.c @@ -371,6 +371,12 @@ static uint32_t imx6_ccm_get_clock_frequency(IMXCCMState *dev, IMXClk clock) case CLK_32k: freq = CKIL_FREQ; break; + case CLK_HIGH: + freq = 24000000; + break; + case CLK_HIGH_DIV: + freq = 24000000 / 8; + break; default: qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: unsupported clock %d\n", TYPE_IMX6_CCM, __func__, clock); |