Skip to content

Commit

Permalink
core: Introduce JAILHOUSE_CON_INVERTED_GATE
Browse files Browse the repository at this point in the history
Some clock drivers use inverted logic of clock gates. This happens to be
the case for Emtrion's drivers.

Add an additional flag JAILHOUSE_CON_INVERTED_GATE to indicate inverted
logic.

This is necessary if we want to decouple clock gating logic from UART
drivers. The reason behind die decoupling: UART devices are not bound to
a specific clock device. Clock gating should happen independently, but
before initialisation of the UART device.

Signed-off-by: Ralf Ramsauer <ralf.ramsauer@oth-regensburg.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information
rralf authored and jan-kiszka committed Jul 5, 2018
1 parent 37c7b05 commit 2e9bd37
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion configs/arm/emtrion-rzg1e.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ struct {
/* .divider = 0x2e, */
.type = JAILHOUSE_CON_TYPE_HSCIF,
.flags = JAILHOUSE_CON_ACCESS_MMIO |
JAILHOUSE_CON_REGDIST_4,
JAILHOUSE_CON_REGDIST_4 |
JAILHOUSE_CON_INVERTED_GATE,
},
.platform_info = {
/* .pci_mmconfig_base = 0x2000000,
Expand Down
3 changes: 2 additions & 1 deletion configs/arm/emtrion-rzg1h.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ struct {
/* .divider = 0x2e, */
.type= JAILHOUSE_CON_TYPE_SCIFA,
.flags = JAILHOUSE_CON_ACCESS_MMIO |
JAILHOUSE_CON_REGDIST_4,
JAILHOUSE_CON_REGDIST_4 |
JAILHOUSE_CON_INVERTED_GATE,
},
.platform_info = {
/* .pci_mmconfig_base = 0x2000000,
Expand Down
3 changes: 2 additions & 1 deletion configs/arm/emtrion-rzg1m.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ struct {
/* .divider = 0x2e, */
.type = JAILHOUSE_CON_TYPE_HSCIF,
.flags = JAILHOUSE_CON_ACCESS_MMIO |
JAILHOUSE_CON_REGDIST_4,
JAILHOUSE_CON_REGDIST_4 |
JAILHOUSE_CON_INVERTED_GATE,
},
.platform_info = {
/* .pci_mmconfig_base = 0x2000000,
Expand Down
9 changes: 9 additions & 0 deletions include/jailhouse/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@

#define CON_USES_REGDIST_1(flags) (((flags) & JAILHOUSE_CON_REGDIST_4) == 0)

/* Bits 2-11: Reserved */

/* Bit 12 is used to indicate to clear instead of to set the clock gate */
#define JAILHOUSE_CON_INVERTED_GATE 0x1000

#define CON_HAS_INVERTED_GATE(flags) !!((flags) & JAILHOUSE_CON_INVERTED_GATE)

/* Bits 13-15: Reserved */

struct jailhouse_console {
__u64 address;
__u32 size;
Expand Down

0 comments on commit 2e9bd37

Please sign in to comment.