#
2f030d28 |
| 03-Feb-2023 |
Rajnesh Kanwal <rkanwal@rivosinc.com> |
riscv: Move serial and rtc from IO port space to MMIO area.
The default serial and rtc IO region overlaps with PCI IO bar region leading bar 0 activation to fail. Moving these devices to MMIO region
riscv: Move serial and rtc from IO port space to MMIO area.
The default serial and rtc IO region overlaps with PCI IO bar region leading bar 0 activation to fail. Moving these devices to MMIO region similar to ARM.
Given serial has been moved from 0x3f8 to 0x10000000, this requires us to now pass earlycon=uart8250,mmio,0x10000000 from cmdline rather than earlycon=uart8250,mmio,0x3f8.
To avoid the need to change the address every time the tool is updated, we can also just pass "earlycon" from cmdline and guest then finds the type and base address by following the Device Tree's stdout-path property.
Signed-off-by: Rajnesh Kanwal <rkanwal@rivosinc.com> Tested-by: Atish Patra <atishp@rivosinc.com> Reviewed-by: Atish Patra <atishp@rivosinc.com> Link: https://lore.kernel.org/r/20230203122934.18714-1-rkanwal@rivosinc.com Signed-off-by: Will Deacon <will@kernel.org>
show more ...
|
#
070fb918 |
| 13-Jul-2021 |
Alexandru Elisei <alexandru.elisei@arm.com> |
Move fdt_irq_fn typedef to fdt.h
The device tree code passes the function generate_irq_prop() to MMIO devices to create the "interrupts" property. The typedef fdt_irq_fn is the type used to pass the
Move fdt_irq_fn typedef to fdt.h
The device tree code passes the function generate_irq_prop() to MMIO devices to create the "interrupts" property. The typedef fdt_irq_fn is the type used to pass the function to the device. It makes more sense for the typedef to be in fdt.h with the rest of the device tree functions, so move it there.
Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com> Link: https://lore.kernel.org/r/20210713170631.155595-2-alexandru.elisei@arm.com Signed-off-by: Will Deacon <will@kernel.org>
show more ...
|
#
382eaad7 |
| 15-Mar-2021 |
Andre Przywara <andre.przywara@arm.com> |
hw/rtc: ARM/arm64: Use MMIO at higher addresses
Using the RTC device at its legacy I/O address as set by IBM in 1981 was a kludge we used for simplicity on ARM platforms as well. However this impose
hw/rtc: ARM/arm64: Use MMIO at higher addresses
Using the RTC device at its legacy I/O address as set by IBM in 1981 was a kludge we used for simplicity on ARM platforms as well. However this imposes problems due to their missing alignment and overlap with the PCI I/O address space.
Now that we can switch a device easily between using ioports and MMIO, let's move the RTC out of the first 4K of memory on ARM platforms.
That should be transparent for well behaved guests, since the change is naturally reflected in the device tree.
Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com> Link: https://lore.kernel.org/r/20210315153350.19988-23-andre.przywara@arm.com Signed-off-by: Will Deacon <will@kernel.org>
show more ...
|
#
123ee474 |
| 15-Mar-2021 |
Andre Przywara <andre.przywara@arm.com> |
hw/rtc: Switch to new trap handler
Now that the RTC device has a trap handler adhering to the MMIO fault handler prototype, let's switch over to the joint registration routine.
This allows us to ge
hw/rtc: Switch to new trap handler
Now that the RTC device has a trap handler adhering to the MMIO fault handler prototype, let's switch over to the joint registration routine.
This allows us to get rid of the ioport shim routines.
Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com> Link: https://lore.kernel.org/r/20210315153350.19988-12-andre.przywara@arm.com Signed-off-by: Will Deacon <will@kernel.org>
show more ...
|
#
8c45f364 |
| 15-Mar-2021 |
Andre Przywara <andre.przywara@arm.com> |
hw/rtc: Refactor trap handlers
With the planned retirement of the special ioport emulation code, we need to provide emulation functions compatible with the MMIO prototype.
Merge the two different t
hw/rtc: Refactor trap handlers
With the planned retirement of the special ioport emulation code, we need to provide emulation functions compatible with the MMIO prototype.
Merge the two different trap handlers into one function, checking for read/write and data/index register inside. Adjust the trap handlers to use that new function, and provide shims to implement the old ioport interface, for now.
Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com> Link: https://lore.kernel.org/r/20210315153350.19988-11-andre.przywara@arm.com Signed-off-by: Will Deacon <will@kernel.org>
show more ...
|
#
5a3a5c07 |
| 14-May-2020 |
Andre Przywara <andre.przywara@arm.com> |
rtc: Generate fdt node for the real-time clock
On arm and arm64 we expose the Motorola RTC emulation to the guest, but never advertised this in the device tree.
EDK-2 seems to rely on this device,
rtc: Generate fdt node for the real-time clock
On arm and arm64 we expose the Motorola RTC emulation to the guest, but never advertised this in the device tree.
EDK-2 seems to rely on this device, but on its hardcoded address. To make this more future-proof, add a DT node with the address in it. EDK-2 can then read the proper address from there, and we can change this address later (with the flexible memory layout).
Please note that an arm64 Linux kernel is not ready to use this device, there are some include files missing under arch/arm64 to compile the driver. I hacked this up in the kernel, just to verify this DT snippet is correct, but don't see much value in enabling this properly in Linux.
Signed-off-by: Andre Przywara <andre.przywara@arm.com> Link: https://lore.kernel.org/r/20200514094553.135663-1-andre.przywara@arm.com Signed-off-by: Will Deacon <will@kernel.org>
show more ...
|
#
473c5b29 |
| 10-Jan-2019 |
Sami Mujawar <sami.mujawar@arm.com> |
rtc: Initialize the Register D for MC146818 RTC
Some software drivers check the VRT bit (BIT7) of Register D before using the MC146818 RTC. Initialized the VRT bit in rtc__init() to indicate that th
rtc: Initialize the Register D for MC146818 RTC
Some software drivers check the VRT bit (BIT7) of Register D before using the MC146818 RTC. Initialized the VRT bit in rtc__init() to indicate that the RAM and time contents are valid.
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Julien Thierry <julien.thierry@arm.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
show more ...
|
#
4123ca55 |
| 27-May-2014 |
Marc Zyngier <marc.zyngier@arm.com> |
kvmtool: virtio: pass trapped vcpu to IO accessors
The recent introduction of bi-endianness on arm/arm64 had the odd effect of breaking virtio-pci support on these platforms, as the device endian fi
kvmtool: virtio: pass trapped vcpu to IO accessors
The recent introduction of bi-endianness on arm/arm64 had the odd effect of breaking virtio-pci support on these platforms, as the device endian field defaults to being VIRTIO_ENDIAN_HOST, which is the wrong thing to have on a bi-endian capable architecture.
The fix is to check for the endianness on the ioport path the same way we do it for mmio, which implies passing the vcpu all the way down. Patch is a bit ugly, but aligns MMIO and ioport nicely.
Tested on arm64 and x86.
Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
97ed4838 |
| 25-Oct-2012 |
Pekka Enberg <penberg@kernel.org> |
kvm tools: Fix reported RTC century and year
Commit 13d5097 ("kvm tools: Fix reported year in RTC emulation) attempted to fix wrongly reported RTC year. However, as pointed out by hpa the proper way
kvm tools: Fix reported RTC century and year
Commit 13d5097 ("kvm tools: Fix reported year in RTC emulation) attempted to fix wrongly reported RTC year. However, as pointed out by hpa the proper way to deal with this is to support the RTC century field.
Suggested-by: H. Peter Anvin <hpa@zytor.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Ron Minnich <rminnich@gmail.com> Cc: Asias He <asias.hejun@gmail.com> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Cc: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
fcb1d916 |
| 15-Oct-2012 |
Ronald G. Minnich <rminnich@gmail.com> |
kvm tools: Fix reported year in RTC emulation
The gmtime() function returns the number of years since 1900.
On PCs, the "design" of CMOS dates is such that the years (in this case) are years since
kvm tools: Fix reported year in RTC emulation
The gmtime() function returns the number of years since 1900.
On PCs, the "design" of CMOS dates is such that the years (in this case) are years since 2000. Fix up RTC emulation as follows:
- if year is > 99, subtract 100 - if year is 99 (20th century) take it as it is
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> [ penberg@kernel.org: cleanups ] Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
4346fd8f |
| 17-Sep-2012 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: remove global kvm object
This was ugly, and now we get rid of it.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
#
49a8afd1 |
| 17-Sep-2012 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: use init/exit where possible
Switch to using init/exit calls instead of the repeating call blocks in builtin-run.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekk
kvm tools: use init/exit where possible
Switch to using init/exit calls instead of the repeating call blocks in builtin-run.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
809f088b |
| 05-Sep-2012 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: remove redundancy between kvm_config and kvm
Remove some redundant members between struct kvm_config and struct kvm since options are now contained within struct kvm.
Signed-off-by: Sash
kvm tools: remove redundancy between kvm_config and kvm
Remove some redundant members between struct kvm_config and struct kvm since options are now contained within struct kvm.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
20c39545 |
| 19-Dec-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Fixes for rtc module
Fixes include: - Error handling - Cleanup - Standard init/uninit
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
|
#
d951bae0 |
| 28-Nov-2011 |
Pekka Enberg <penberg@kernel.org> |
kvm tools, rtc: Nonvolatile BIOS memory support
This adds a ->cmos_data array to 'struct rtc_device' that is used to emulate nonvolatile BIOS memory and the RTC registers.
Signed-off-by: Pekka Enbe
kvm tools, rtc: Nonvolatile BIOS memory support
This adds a ->cmos_data array to 'struct rtc_device' that is used to emulate nonvolatile BIOS memory and the RTC registers.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
c717392f |
| 28-Nov-2011 |
Pekka Enberg <penberg@kernel.org> |
kvm tools, rtc: Implement RTC_DAY_OF_WEEK
This patch implements support for RTC_DAY_OF_WEEK RTC register.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
#
c8f6893b |
| 28-Nov-2011 |
Pekka Enberg <penberg@kernel.org> |
kvm tools, rtc: Add RTC register names
Add missing RTC register names to hw/rtc.c and rename the current ones to follow <linux/mc146818rtc.h> naming. It would be nice to use the header directly but
kvm tools, rtc: Add RTC register names
Add missing RTC register names to hw/rtc.c and rename the current ones to follow <linux/mc146818rtc.h> naming. It would be nice to use the header directly but unfortunately it includes <linux/spinlock.h>.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
2f062989 |
| 28-Nov-2011 |
Pekka Enberg <penberg@kernel.org> |
kvm tools, rtc: Introduce 'struct rtc_device'
This patch introduces a 'struct rtc_device' in preparation for implementing missing RTC features like alarms which need auxiliary data structures.
Sign
kvm tools, rtc: Introduce 'struct rtc_device'
This patch introduces a 'struct rtc_device' in preparation for implementing missing RTC features like alarms which need auxiliary data structures.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
c9f6a037 |
| 18-Aug-2011 |
Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> |
kvm tools: remove count in io emulation callbacks
'count' parameter in io emulation callbacks is useless, just remove it
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Signed-off-by:
kvm tools: remove count in io emulation callbacks
'count' parameter in io emulation callbacks is useless, just remove it
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
3d62dea6 |
| 26-May-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Add optional parameter used in ioport callbacks
Allow specifying an optional parameter when registering an ioport range. The callback functions provided by the registering module will be
kvm tools: Add optional parameter used in ioport callbacks
Allow specifying an optional parameter when registering an ioport range. The callback functions provided by the registering module will be called with the same parameter.
This may be used to keep context during callbacks on IO operations.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
f5fc024d |
| 18-May-2011 |
Pekka Enberg <penberg@kernel.org> |
kvm tools: Move hardware drivers to hw directory
This patch moves hypervisor native hardware emulation drivers to "hw" directory like we've done for virtio and disk image code.
Acked-by: Cyrill Gor
kvm tools: Move hardware drivers to hw directory
This patch moves hypervisor native hardware emulation drivers to "hw" directory like we've done for virtio and disk image code.
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
43835ac9 |
| 11-May-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Rename 'self' variables
Give proper names to vars named 'self'.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
#
3fdf659d |
| 05-May-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Abolishment of uint*_t types
Clean uint*_t type from the code.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
#
64136c1c |
| 28-Apr-2011 |
Pekka Enberg <penberg@kernel.org> |
kvm tools: Emulate RTC to fix system time in guests
This patch fixes system time in guests by implementing proper CMOS RTC clock support.
# Before:
sh-2.05b# date Fri Aug 7 04:02:01 UTC 200
kvm tools: Emulate RTC to fix system time in guests
This patch fixes system time in guests by implementing proper CMOS RTC clock support.
# Before:
sh-2.05b# date Fri Aug 7 04:02:01 UTC 2009
# After:
sh-2.05b# date Thu Apr 28 19:12:21 UTC 2011
Cc: Asias He <asias.hejun@gmail.com> Cc: Cyrill Gorcunov <gorcunov@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Prasad Joshi <prasadjoshi124@gmail.com> Cc: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|