Skip to contentSkip to conversation

biosemu: include <asm/io.h> header

PATCH In review Linus Walleij 3 participants 10 messages Apr 2, 2013 – Apr 4, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 biosemu: include <asm/io.h> header

This makes sure we have inline functions such as inb/outb that are used in these two files by including the arch-specific <asm/io.h> header. However the ARM version does not provide the accessors unless the config symbol __io is also defined so add that in front of the include.

After this the bios emulator will compile on ARM systems.

---
 drivers/bios_emulator/besys.c | 2 ++
 drivers/bios_emulator/bios.c  | 2 ++
 2 files changed, 4 insertions(+)
drivers/bios_emulator/besys.c +2 -0
index 84724b7..ad88a53 100644
@@ -47,6 +47,8 @@
 *
 ****************************************************************************/
 
+#define __io
+#include <asm/io.h>
 #include <common.h>
 #include "biosemui.h"
 
drivers/bios_emulator/bios.c +2 -0
index 7cf4879..bcc192f 100644
@@ -41,6 +41,8 @@
 *
 ****************************************************************************/
 
+#define __io
+#include <asm/io.h>
 #include <common.h>
 #include "biosemui.h"
 
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/1 biosemu: include <asm/io.h> header

Hi Linus,

Quoted 32 lines · Linus Walleij

This makes sure we have inline functions such as inb/outb that are used in these two files by including the arch-specific <asm/io.h> header. However the ARM version does not provide the accessors unless the config symbol __io is also defined so add that in front of the include.

After this the bios emulator will compile on ARM systems.

---
 drivers/bios_emulator/besys.c | 2 ++
 drivers/bios_emulator/bios.c  | 2 ++
 2 files changed, 4 insertions(+)
drivers/bios_emulator/besys.c +2 -0
index 84724b7..ad88a53 100644
@@ -47,6 +47,8 @@
 *
 ****************************************************************************/
 
+#define __io
+#include <asm/io.h>
 #include <common.h>
 #include "biosemui.h"
 
drivers/bios_emulator/bios.c +0 -0
index 7cf4879..bcc192f 100644

drivers/bios_emulator/bios.c line 47

Quoted 7 lines
drivers/bios_emulator/bios.c +2 -0
@@ -41,6 +41,8 @@
 *
 ****************************************************************************/
 
+#define __io
+#include <asm/io.h>
 #include <common.h>
 #include "biosemui.h"

NAK -- no ARM target needs bios emulation, so basing the #define on ARM requirements is incorrect.

Actually, ARM targets build drivers/bios_emulator/libatibiosemu.o as the result of an overlook in ./Makefile where this object is compiled unconditionally.

A git grep CONFIG_BIOSEMU seems to indicate only a handful of PowerPC targets need bios emulation; I suggest doing a V2 of this patch where the object is built only for PowerPC, and the #define is removed.

Amicalement,

Signature · 1 line
Albert.
#2 lore raw

PATCH 1/1 biosemu: include <asm/io.h> header

Quoted 10 lines · Albert ARIBAUD

NAK -- no ARM target needs bios emulation, so basing the #define on ARM requirements is incorrect.

Actually, ARM targets build drivers/bios_emulator/libatibiosemu.o as the result of an overlook in ./Makefile where this object is compiled unconditionally.

A git grep CONFIG_BIOSEMU seems to indicate only a handful of PowerPC targets need bios emulation; I suggest doing a V2 of this patch where the object is built only for PowerPC, and the #define is removed.

So the patch was initiated by the discussion here:
http://marc.info/?l=linux-arm-kernel&m=136399798826572&w=2

I am looking into getting biosemu up on ARM for the PCI-equipped ARM boards, but admittedly I have no idea where it'll go.

But this can surely wait until I have a series that can be run as well.

Yours,
Linus Walleij

#3 lore raw

PATCH 1/1 biosemu: include <asm/io.h> header

Hi Linus,

Quoted 14 lines · Linus Walleij
Quoted 10 lines · Albert ARIBAUD

NAK -- no ARM target needs bios emulation, so basing the #define on ARM requirements is incorrect.

Actually, ARM targets build drivers/bios_emulator/libatibiosemu.o as the result of an overlook in ./Makefile where this object is compiled unconditionally.

A git grep CONFIG_BIOSEMU seems to indicate only a handful of PowerPC targets need bios emulation; I suggest doing a V2 of this patch where the object is built only for PowerPC, and the #define is removed.

Quoted 7 lines

So the patch was initiated by the discussion here:
http://marc.info/?l=linux-arm-kernel&m=136399798826572&w=2

I am looking into getting biosemu up on ARM for the PCI-equipped ARM boards, but admittedly I have no idea where it'll go.

But this can surely wait until I have a series that can be run as well.

Indeed: when some real ARM target needs biosemu, then yes, this patch will make sense as part of the series that introduces this target.

Quoted 2 lines

Yours,
Linus Walleij

Amicalement,

Signature · 1 line
Albert.
#4 lore raw

PATCH 1/1 biosemu: include <asm/io.h> header

Quoted 22 lines · Albert ARIBAUD

Hi Linus,

Quoted 17 lines · Linus Walleij
Quoted 10 lines · Albert ARIBAUD

NAK -- no ARM target needs bios emulation, so basing the #define on ARM requirements is incorrect.

Actually, ARM targets build drivers/bios_emulator/libatibiosemu.o as the result of an overlook in ./Makefile where this object is compiled unconditionally.

A git grep CONFIG_BIOSEMU seems to indicate only a handful of PowerPC targets need bios emulation; I suggest doing a V2 of this patch where the object is built only for PowerPC, and the #define is removed.

So the patch was initiated by the discussion here:
http://marc.info/?l=linux-arm-kernel&m=136399798826572&w=2

Quoted 7 lines
Quoted 4 lines

I am looking into getting biosemu up on ARM for the PCI-equipped ARM boards, but admittedly I have no idea where it'll go.

But this can surely wait until I have a series that can be run as well.

Indeed: when some real ARM target needs biosemu, then yes, this patch will make sense as part of the series that introduces this target.

Grr, I missed this discussion, sorry. But I don't feel this falls into the "no dead code" rule, but does fall into the "lets not make life too hard for others" rule I have at least. There's at least one board in u-boot-arm now (ti814x) which can get PCI turned on, with further work, and another that was posted recently (ti816x), and more coming down the pipe. And also what Linus has access to.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130403/b68e26da/attachment.pgp>
#5 lore raw

PATCH 1/1 biosemu: include <asm/io.h> header

Quoted 6 lines · Tom Rini

Grr, I missed this discussion, sorry. But I don't feel this falls into the "no dead code" rule, but does fall into the "lets not make life too hard for others" rule I have at least. There's at least one board in u-boot-arm now (ti814x) which can get PCI turned on, with further work, and another that was posted recently (ti816x), and more coming down the pipe. And also what Linus has access to.

Yes the Integrator has PCI support since ages, and I do have a VGA card mounted in one of the slots ... the only issue is that I need biosemu to be working to initialize it. More people will run into the same issue definately, especially with ARM servers and such things using PCI starting to appear.

Yours,
Linus Walleij

#6 lore raw

PATCH 1/1 biosemu: include <asm/io.h> header

Quoted 9 lines · Linus Walleij
Quoted 6 lines · Tom Rini

Grr, I missed this discussion, sorry. But I don't feel this falls into the "no dead code" rule, but does fall into the "lets not make life too hard for others" rule I have at least. There's at least one board in u-boot-arm now (ti814x) which can get PCI turned on, with further work, and another that was posted recently (ti816x), and more coming down the pipe. And also what Linus has access to.

Quoted 5 lines

Yes the Integrator has PCI support since ages, and I do have a VGA card mounted in one of the slots ... the only issue is that I need biosemu to be working to initialize it. More people will run into the same issue definately, especially with ARM servers and such things using PCI starting to appear.

Can you pass along a patch to enable this stuff for integrator then please? That should keep everyone happy then, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130403/7266ebcd/attachment.pgp>
#7 lore raw

PATCH 1/1 biosemu: include <asm/io.h> header

Quoted 10 lines · Tom Rini
Quoted 6 lines · Linus Walleij

Yes the Integrator has PCI support since ages, and I do have a VGA card mounted in one of the slots ... the only issue is that I need biosemu to be working to initialize it. More people will run into the same issue definately, especially with ARM servers and such things using PCI starting to appear.

Can you pass along a patch to enable this stuff for integrator then please? That should keep everyone happy then, thanks!

Well, it can be enabled for example like this:

+#define CONFIG_VIDEO
+#define VIDEO_IO_OFFSET 0x60000000 +#define CONFIG_SYS_ISA_IO_BASE_ADDRESS 0x60000000 +#define CONFIG_BIOSEMU
+#define CONFIG_CFB_CONSOLE
+#define CONFIG_VIDEO_SW_CURSOR
+#define CONFIG_VGA_AS_SINGLE_DEVICE +#define CONFIG_ATI_RADEON_FB
+#define CONFIG_VIDEO_LOGO

The thing is that since it's more or less a PC form-factor thing with PCI slots, enabling VGA emulation and the Radeon driver is just overhead for everyone without such a card in their machine.

I was more thinking about making it possible to do this, not necessarily enabling it by default and increasing the overhead for everyone...

Yours,
Linus Walleij

#8 lore raw

PATCH 1/1 biosemu: include <asm/io.h> header

Quoted 24 lines · Linus Walleij
Quoted 10 lines · Tom Rini
Quoted 6 lines · Linus Walleij

Yes the Integrator has PCI support since ages, and I do have a VGA card mounted in one of the slots ... the only issue is that I need biosemu to be working to initialize it. More people will run into the same issue definately, especially with ARM servers and such things using PCI starting to appear.

Can you pass along a patch to enable this stuff for integrator then please? That should keep everyone happy then, thanks!

Well, it can be enabled for example like this:

(quoted diff) +9 -0
+#define CONFIG_VIDEO
+#define VIDEO_IO_OFFSET 0x60000000
+#define CONFIG_SYS_ISA_IO_BASE_ADDRESS 0x60000000
+#define CONFIG_BIOSEMU
+#define CONFIG_CFB_CONSOLE
+#define CONFIG_VIDEO_SW_CURSOR
+#define CONFIG_VGA_AS_SINGLE_DEVICE
+#define CONFIG_ATI_RADEON_FB
+#define CONFIG_VIDEO_LOGO
Quoted 7 lines

The thing is that since it's more or less a PC form-factor thing with PCI slots, enabling VGA emulation and the Radeon driver is just overhead for everyone without such a card in their machine.

I was more thinking about making it possible to do this, not necessarily enabling it by default and increasing the overhead for everyone...

Fair enough, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130404/e0e248b9/attachment.pgp>
#9 lore raw
In reply to Linus Walleij
Quoted 9 lines · Linus Walleij

This makes sure we have inline functions such as inb/outb that are used in these two files by including the arch-specific <asm/io.h> header. However the ARM version does not provide the accessors unless the config symbol __io is also defined so add that in front of the include.

After this the bios emulator will compile on ARM systems.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130403/c34bdcdf/attachment.pgp>