mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
hw: irq controller and timer improvements for Rpi
* renamed rpi pic to Bcm2835_pic * renamed rpi3 pic to Bcm2837_pic * added bcm2837 control for setting prescaler value (to fix timer_accuracy) * changed handling of all interrupts for rpi3 by cascading to bcm2835 pic * rpi3 irq controller base address made consistent with rpi * added usb controller memory region for pic on rpi3 (for SOF interrupts) Ref #3415
This commit is contained in:
committed by
Christian Helmuth
parent
7db602faec
commit
f79d5d640f
61
repos/base/include/drivers/platform/bcm2837_control.h
Normal file
61
repos/base/include/drivers/platform/bcm2837_control.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* \brief Driver for the platform specific functionality for bcm2837
|
||||
* \author Tomasz Gajewski
|
||||
* \date 2019-12-28
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2011-2019 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__DRIVERS__PLATFORM__BCM2837_CONTROL_H_
|
||||
#define _INCLUDE__DRIVERS__PLATFORM__BCM2837_CONTROL_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <util/mmio.h>
|
||||
|
||||
|
||||
namespace Genode { class Bcm2837_control; }
|
||||
|
||||
|
||||
class Genode::Bcm2837_control : Mmio
|
||||
{
|
||||
public:
|
||||
|
||||
struct ControlRegister : public Register<0x0, 32>
|
||||
{
|
||||
struct CoreTimeClockSource : Bitfield<8,1> { };
|
||||
struct TimerIncrement : Bitfield<9,1> { };
|
||||
};
|
||||
|
||||
struct CoreTimerPrescaler : public Register<0x8, 32>
|
||||
{
|
||||
};
|
||||
|
||||
inline Bcm2837_control(addr_t const base);
|
||||
|
||||
inline void initialize_timer_frequency();
|
||||
};
|
||||
|
||||
|
||||
Genode::Bcm2837_control::Bcm2837_control(addr_t const base)
|
||||
:
|
||||
Mmio(base)
|
||||
{ }
|
||||
|
||||
|
||||
void Genode::Bcm2837_control::initialize_timer_frequency()
|
||||
{
|
||||
/*
|
||||
* Set prescaler value to achieve divider value equal to 1.
|
||||
* Value taken from chapter "3.1.1 Timer clock" from QA7_rev3.4.pdf
|
||||
* document describing the BCM2836 chip.
|
||||
*/
|
||||
write<CoreTimerPrescaler>(0x80000000);
|
||||
}
|
||||
|
||||
|
||||
#endif /* _INCLUDE__DRIVERS__PLATFORM__BCM2837_CONTROL_H_ */
|
||||
Reference in New Issue
Block a user