* [PATCH 1/2] Subject: parisc: Fix pdc_toc_pim_11 and pdc_toc_pim_20 structs
@ 2022-01-05 21:45 Helge Deller
2022-01-05 21:45 ` [PATCH 2/2] parisc: Provide a trivial PDC-based io_module for kgdb Helge Deller
0 siblings, 1 reply; 4+ messages in thread
From: Helge Deller @ 2022-01-05 21:45 UTC (permalink / raw)
To: linux-parisc; +Cc: James Bottomley, John David Anglin, Sven Schnelle
The definitions for pdc_toc_pim_11 and pdc_toc_pim_20 structs are wrong
since they include an entry for a hversion version field which isn't
in the specification.
Fix this and clean up some whitespaces so that the whole file will be in
sync with it's copy in the SeaBIOS-hppa sources.
Signed-off-by: Helge Deller <deller@gmx.de>
---
arch/parisc/include/uapi/asm/pdc.h | 32 +++++++++++++++++++++---------
1 file changed, 23 insertions(+), 9 deletions(-)
diff --git a/arch/parisc/include/uapi/asm/pdc.h b/arch/parisc/include/uapi/asm/pdc.h
index acc633c15722..e794e143ec5f 100644
--- a/arch/parisc/include/uapi/asm/pdc.h
+++ b/arch/parisc/include/uapi/asm/pdc.h
@@ -4,7 +4,7 @@
/*
* PDC return values ...
- * All PDC calls return a subset of these errors.
+ * All PDC calls return a subset of these errors.
*/
#define PDC_WARN 3 /* Call completed with a warning */
@@ -165,7 +165,7 @@
#define PDC_PSW_GET_DEFAULTS 1 /* Return defaults */
#define PDC_PSW_SET_DEFAULTS 2 /* Set default */
#define PDC_PSW_ENDIAN_BIT 1 /* set for big endian */
-#define PDC_PSW_WIDE_BIT 2 /* set for wide mode */
+#define PDC_PSW_WIDE_BIT 2 /* set for wide mode */
#define PDC_SYSTEM_MAP 22 /* find system modules */
#define PDC_FIND_MODULE 0
@@ -274,7 +274,7 @@
#define PDC_PCI_PCI_INT_ROUTE_SIZE 13
#define PDC_PCI_GET_INT_TBL_SIZE PDC_PCI_PCI_INT_ROUTE_SIZE
#define PDC_PCI_PCI_INT_ROUTE 14
-#define PDC_PCI_GET_INT_TBL PDC_PCI_PCI_INT_ROUTE
+#define PDC_PCI_GET_INT_TBL PDC_PCI_PCI_INT_ROUTE
#define PDC_PCI_READ_MON_TYPE 15
#define PDC_PCI_WRITE_MON_TYPE 16
@@ -345,7 +345,7 @@
/* constants for PDC_CHASSIS */
#define OSTAT_OFF 0
-#define OSTAT_FLT 1
+#define OSTAT_FLT 1
#define OSTAT_TEST 2
#define OSTAT_INIT 3
#define OSTAT_SHUT 4
@@ -403,7 +403,7 @@ struct zeropage {
int vec_pad1[6];
/* [0x040] reserved processor dependent */
- int pad0[112];
+ int pad0[112]; /* in QEMU pad0[0] holds "SeaBIOS\0" */
/* [0x200] reserved */
int pad1[84];
@@ -691,6 +691,22 @@ struct pdc_hpmc_pim_20 { /* PDC_PIM */
unsigned long long fr[32];
};
+struct pim_cpu_state_cf {
+ union {
+ unsigned int
+ iqv : 1, /* IIA queue Valid */
+ iqf : 1, /* IIA queue Failure */
+ ipv : 1, /* IPRs Valid */
+ grv : 1, /* GRs Valid */
+ crv : 1, /* CRs Valid */
+ srv : 1, /* SRs Valid */
+ trv : 1, /* CR24 through CR31 valid */
+ pad : 24, /* reserved */
+ td : 1; /* TOC did not cause any damage to the system state */
+ unsigned int val;
+ };
+};
+
struct pdc_toc_pim_11 {
unsigned int gr[32];
unsigned int cr[32];
@@ -698,8 +714,7 @@ struct pdc_toc_pim_11 {
unsigned int iasq_back;
unsigned int iaoq_back;
unsigned int check_type;
- unsigned int hversion;
- unsigned int cpu_state;
+ struct pim_cpu_state_cf cpu_state;
};
struct pdc_toc_pim_20 {
@@ -709,8 +724,7 @@ struct pdc_toc_pim_20 {
unsigned long long iasq_back;
unsigned long long iaoq_back;
unsigned int check_type;
- unsigned int hversion;
- unsigned int cpu_state;
+ struct pim_cpu_state_cf cpu_state;
};
#endif /* !defined(__ASSEMBLY__) */
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] parisc: Provide a trivial PDC-based io_module for kgdb
2022-01-05 21:45 [PATCH 1/2] Subject: parisc: Fix pdc_toc_pim_11 and pdc_toc_pim_20 structs Helge Deller
@ 2022-01-05 21:45 ` Helge Deller
2022-01-06 10:04 ` Rolf Eike Beer
0 siblings, 1 reply; 4+ messages in thread
From: Helge Deller @ 2022-01-05 21:45 UTC (permalink / raw)
To: linux-parisc; +Cc: James Bottomley, John David Anglin, Sven Schnelle
Add a simple keyboard driver for usage of PDC I/O functions
with kgdb. This driver makes it possible to use KGDB with QEMU.
Signed-off-by: Helge Deller <deller@gmx.de>
---
arch/parisc/kernel/toc.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/arch/parisc/kernel/toc.c b/arch/parisc/kernel/toc.c
index 18327611cf8f..dfe7cccc086f 100644
--- a/arch/parisc/kernel/toc.c
+++ b/arch/parisc/kernel/toc.c
@@ -109,3 +109,30 @@ static __init int setup_toc(void)
return 0;
}
early_initcall(setup_toc);
+
+
+#ifdef CONFIG_KGDB_KDB
+/* read a character, return -1 if no char can be polled. */
+static int kgdbpdc_read_char(void)
+{
+ return pdc_iodc_getc();
+}
+
+static void kgdbpdc_write_char(u8 chr)
+{
+ /* no need to print char. kdb will do it. */
+}
+
+static struct kgdb_io kgdbpdc_io_ops = {
+ .name = "kgdb_pdc",
+ .read_char = kgdbpdc_read_char,
+ .write_char = kgdbpdc_write_char,
+};
+
+static int __init kgdbpdc_init(void)
+{
+ kgdb_register_io_module(&kgdbpdc_io_ops);
+ return 0;
+}
+early_initcall(kgdbpdc_init);
+#endif
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] parisc: Provide a trivial PDC-based io_module for kgdb
2022-01-05 21:45 ` [PATCH 2/2] parisc: Provide a trivial PDC-based io_module for kgdb Helge Deller
@ 2022-01-06 10:04 ` Rolf Eike Beer
2022-01-06 10:32 ` Helge Deller
0 siblings, 1 reply; 4+ messages in thread
From: Rolf Eike Beer @ 2022-01-06 10:04 UTC (permalink / raw)
To: linux-parisc, Helge Deller
Cc: James Bottomley, John David Anglin, Sven Schnelle
[-- Attachment #1: Type: text/plain, Size: 930 bytes --]
Am Mittwoch, 5. Januar 2022, 22:45:52 CET schrieb Helge Deller:
> Add a simple keyboard driver for usage of PDC I/O functions
> with kgdb. This driver makes it possible to use KGDB with QEMU.
>
> Signed-off-by: Helge Deller <deller@gmx.de>
> ---
> arch/parisc/kernel/toc.c | 27 +++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
> diff --git a/arch/parisc/kernel/toc.c b/arch/parisc/kernel/toc.c
> index 18327611cf8f..dfe7cccc086f 100644
> --- a/arch/parisc/kernel/toc.c
> +++ b/arch/parisc/kernel/toc.c
> @@ -109,3 +109,30 @@ static __init int setup_toc(void)
> return 0;
> }
> early_initcall(setup_toc);
> +
> +
double newline
> +#ifdef CONFIG_KGDB_KDB
> +/* read a character, return -1 if no char can be polled. */
> +static int kgdbpdc_read_char(void)
> +{
> + return pdc_iodc_getc();
> +}
> +
> +static void kgdbpdc_write_char(u8 chr)
> +{
> + /* no need to print char. kdb will do it. */
kgdb?
Eike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] parisc: Provide a trivial PDC-based io_module for kgdb
2022-01-06 10:04 ` Rolf Eike Beer
@ 2022-01-06 10:32 ` Helge Deller
0 siblings, 0 replies; 4+ messages in thread
From: Helge Deller @ 2022-01-06 10:32 UTC (permalink / raw)
To: Rolf Eike Beer, linux-parisc
Cc: James Bottomley, John David Anglin, Sven Schnelle
On 1/6/22 11:04, Rolf Eike Beer wrote:
> Am Mittwoch, 5. Januar 2022, 22:45:52 CET schrieb Helge Deller:
>> Add a simple keyboard driver for usage of PDC I/O functions
>> with kgdb. This driver makes it possible to use KGDB with QEMU.
>>
>> Signed-off-by: Helge Deller <deller@gmx.de>
>> ---
>> arch/parisc/kernel/toc.c | 27 +++++++++++++++++++++++++++
>> 1 file changed, 27 insertions(+)
>>
>> diff --git a/arch/parisc/kernel/toc.c b/arch/parisc/kernel/toc.c
>> index 18327611cf8f..dfe7cccc086f 100644
>> --- a/arch/parisc/kernel/toc.c
>> +++ b/arch/parisc/kernel/toc.c
>> @@ -109,3 +109,30 @@ static __init int setup_toc(void)
>> return 0;
>> }
>> early_initcall(setup_toc);
>> +
>> +
>
> double newline
>
>> +#ifdef CONFIG_KGDB_KDB
>> +/* read a character, return -1 if no char can be polled. */
>> +static int kgdbpdc_read_char(void)
>> +{
>> + return pdc_iodc_getc();
>> +}
>> +
>> +static void kgdbpdc_write_char(u8 chr)
>> +{
>> + /* no need to print char. kdb will do it. */
>
> kgdb?
Thanks, I fixed this and moved the driver to kgdb.c...
Helge
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-01-06 10:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-05 21:45 [PATCH 1/2] Subject: parisc: Fix pdc_toc_pim_11 and pdc_toc_pim_20 structs Helge Deller
2022-01-05 21:45 ` [PATCH 2/2] parisc: Provide a trivial PDC-based io_module for kgdb Helge Deller
2022-01-06 10:04 ` Rolf Eike Beer
2022-01-06 10:32 ` Helge Deller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox