mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-12-25 18:29:49 +00:00
hmc: self-registration with the device registry.
This commit is contained in:
parent
66debbc730
commit
cb68b70d52
@ -24,6 +24,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
Author: Max Poliakovski
|
Author: Max Poliakovski
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <devices/deviceregistry.h>
|
||||||
#include <devices/common/hwcomponent.h>
|
#include <devices/common/hwcomponent.h>
|
||||||
#include <devices/memctrl/hmc.h>
|
#include <devices/memctrl/hmc.h>
|
||||||
|
|
||||||
@ -63,3 +64,9 @@ void HMC::write(uint32_t reg_start, uint32_t offset, uint32_t value, int size)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const DeviceDescription Hmc_Descriptor = {
|
||||||
|
HMC::create, {}, {}
|
||||||
|
};
|
||||||
|
|
||||||
|
REGISTER_DEVICE(HMC, Hmc_Descriptor);
|
||||||
|
@ -35,6 +35,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
#include <devices/memctrl/memctrlbase.h>
|
#include <devices/memctrl/memctrlbase.h>
|
||||||
|
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
/** Bit in the HMC control register telling us where the frame bufffer
|
/** Bit in the HMC control register telling us where the frame bufffer
|
||||||
for the on-board video is located. */
|
for the on-board video is located. */
|
||||||
@ -45,6 +46,10 @@ public:
|
|||||||
HMC();
|
HMC();
|
||||||
~HMC() = default;
|
~HMC() = default;
|
||||||
|
|
||||||
|
static std::unique_ptr<HWComponent> create() {
|
||||||
|
return std::unique_ptr<HMC>(new HMC());
|
||||||
|
}
|
||||||
|
|
||||||
/* MMIODevice methods */
|
/* MMIODevice methods */
|
||||||
uint32_t read(uint32_t reg_start, uint32_t offset, int size);
|
uint32_t read(uint32_t reg_start, uint32_t offset, int size);
|
||||||
void write(uint32_t reg_start, uint32_t offset, uint32_t value, int size);
|
void write(uint32_t reg_start, uint32_t offset, uint32_t value, int size);
|
||||||
|
Loading…
Reference in New Issue
Block a user