2020-02-06 23:09:38

by Finn Thain

[permalink] [raw]
Subject: [PATCH v2 0/3] Improve MIPS Magnum support

A few minor patches are needed to more easily boot a MIPS Magnum build
under QEMU. This series fixes a build failure in the g364fb driver and
modifies jazz_defconfig for use with 'qemu-system-mips64el -M magnum'.

Note that QEMU's dp8393x implementation has bugs, one of which prevents
the Linux jazzsonic driver from probing the chip. I have fixed the bugs
that I know of in a series of patches at,
https://github.com/fthain/qemu/commits/sonic

Changed since v1:
- Added reviewed-by and tested-by tags from Philippe Mathieu-Daudé.
- Rebased.


Finn Thain (3):
fbdev/g364fb: Fix build failure
mips/jazz: Remove redundant settings and shrink jazz_defconfig
mips/jazz: Update jazz_defconfig for MIPS Magnum

arch/mips/configs/jazz_defconfig | 267 ++-----------------------------
drivers/video/fbdev/g364fb.c | 29 +---
2 files changed, 15 insertions(+), 281 deletions(-)

--
2.24.1


2020-02-06 23:09:41

by Finn Thain

[permalink] [raw]
Subject: [PATCH v2 3/3] mips/jazz: Update jazz_defconfig for MIPS Magnum

Enable some options for machine type, framebuffer, serial controller and
ATA interfaces.

This allows a jazz_defconfig build to work on the emulated MIPS Magnum
machine provided by qemu-system-mips64el.

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Tested-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Finn Thain <[email protected]>
---
This patch enables CONFIG_FB_G364. This depends upon the build fix at
the beginning of this patch series.
---
arch/mips/configs/jazz_defconfig | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/mips/configs/jazz_defconfig b/arch/mips/configs/jazz_defconfig
index b13b2396a8a9..92085df3e367 100644
--- a/arch/mips/configs/jazz_defconfig
+++ b/arch/mips/configs/jazz_defconfig
@@ -1,5 +1,7 @@
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
CONFIG_PREEMPT_VOLUNTARY=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_LOG_BUF_SHIFT=14
@@ -8,6 +10,8 @@ CONFIG_EXPERT=y
CONFIG_SLAB=y
CONFIG_MACH_JAZZ=y
CONFIG_OLIVETTI_M700=y
+CONFIG_MIPS_MAGNUM_4000=y
+CONFIG_CPU_LITTLE_ENDIAN=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y
@@ -25,6 +29,7 @@ CONFIG_INET6_IPCOMP=m
CONFIG_PARPORT=m
CONFIG_PARPORT_PC=m
CONFIG_PARPORT_1284=y
+CONFIG_DEVTMPFS=y
CONFIG_BLK_DEV_FD=m
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_CRYPTOLOOP=m
@@ -44,6 +49,8 @@ CONFIG_ISCSI_TCP=m
CONFIG_SCSI_PPA=m
CONFIG_SCSI_IMM=m
CONFIG_JAZZ_ESP=y
+CONFIG_ATA=y
+CONFIG_PATA_LEGACY=y
CONFIG_NETDEVICES=y
CONFIG_BONDING=m
CONFIG_DUMMY=m
@@ -54,11 +61,15 @@ CONFIG_NE2000=m
CONFIG_SERIO_PARKBD=m
CONFIG_SERIO_RAW=m
CONFIG_VT_HW_CONSOLE_BINDING=y
-CONFIG_SERIAL_8250=m
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y
+CONFIG_FB=y
+CONFIG_FB_G364=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
# CONFIG_HWMON is not set
CONFIG_EXT2_FS=m
CONFIG_EXT3_FS=y
--
2.24.1

2020-02-06 23:10:05

by Finn Thain

[permalink] [raw]
Subject: [PATCH v2 1/3] fbdev/g364fb: Fix build failure

This patch resolves these compiler errors and warnings --

CC drivers/video/fbdev/g364fb.o
drivers/video/fbdev/g364fb.c: In function 'g364fb_cursor':
drivers/video/fbdev/g364fb.c:137:9: error: 'x' undeclared (first use in this function)
drivers/video/fbdev/g364fb.c:137:9: note: each undeclared identifier is reported only once for each function it appears in
drivers/video/fbdev/g364fb.c:137:7: error: implicit declaration of function 'fontwidth' [-Werror=implicit-function-declaration]
drivers/video/fbdev/g364fb.c:137:23: error: 'p' undeclared (first use in this function)
drivers/video/fbdev/g364fb.c:137:38: error: 'y' undeclared (first use in this function)
drivers/video/fbdev/g364fb.c:137:7: error: implicit declaration of function 'fontheight' [-Werror=implicit-function-declaration]
drivers/video/fbdev/g364fb.c: In function 'g364fb_init':
drivers/video/fbdev/g364fb.c:233:24: error: 'fbvar' undeclared (first use in this function)
drivers/video/fbdev/g364fb.c:234:24: error: 'xres' undeclared (first use in this function)
drivers/video/fbdev/g364fb.c:201:14: warning: unused variable 'j' [-Wunused-variable]
drivers/video/fbdev/g364fb.c:197:25: warning: unused variable 'pal_ptr' [-Wunused-variable]

The MIPS Magnum framebuffer console now works when tested in QEMU.

Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Finn Thain <[email protected]>
---
drivers/video/fbdev/g364fb.c | 29 +++--------------------------
1 file changed, 3 insertions(+), 26 deletions(-)

diff --git a/drivers/video/fbdev/g364fb.c b/drivers/video/fbdev/g364fb.c
index 845b79da2a7c..05837a3b985c 100644
--- a/drivers/video/fbdev/g364fb.c
+++ b/drivers/video/fbdev/g364fb.c
@@ -108,7 +108,6 @@ static int g364fb_pan_display(struct fb_var_screeninfo *var,
static int g364fb_setcolreg(u_int regno, u_int red, u_int green,
u_int blue, u_int transp,
struct fb_info *info);
-static int g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor);
static int g364fb_blank(int blank, struct fb_info *info);

static const struct fb_ops g364fb_ops = {
@@ -119,28 +118,8 @@ static const struct fb_ops g364fb_ops = {
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit,
- .fb_cursor = g364fb_cursor,
};

-int g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
-{
-
- switch (cursor->enable) {
- case CM_ERASE:
- *(unsigned int *) CTLA_REG |= CURS_TOGGLE;
- break;
-
- case CM_MOVE:
- case CM_DRAW:
- *(unsigned int *) CTLA_REG &= ~CURS_TOGGLE;
- *(unsigned int *) CURS_POS_REG =
- ((x * fontwidth(p)) << 12) | ((y * fontheight(p)) -
- info->var.yoffset);
- break;
- }
- return 0;
-}
-
/*
* Pan or Wrap the Display
*
@@ -194,11 +173,9 @@ static int g364fb_setcolreg(u_int regno, u_int red, u_int green,
*/
int __init g364fb_init(void)
{
- volatile unsigned int *pal_ptr =
- (volatile unsigned int *) CLR_PAL_REG;
volatile unsigned int *curs_pal_ptr =
(volatile unsigned int *) CURS_PAL_REG;
- int mem, i, j;
+ int mem, i;

if (fb_get_options("g364fb", NULL))
return -ENODEV;
@@ -230,8 +207,8 @@ int __init g364fb_init(void)
*/
*(unsigned short *) (CURS_PAT_REG + 14 * 64) = 0xffff;
*(unsigned short *) (CURS_PAT_REG + 15 * 64) = 0xffff;
- fb_var.xres_virtual = fbvar.xres;
- fb_fix.line_length = (xres / 8) * fb_var.bits_per_pixel;
+ fb_var.xres_virtual = fb_var.xres;
+ fb_fix.line_length = fb_var.xres_virtual * fb_var.bits_per_pixel / 8;
fb_fix.smem_start = 0x40000000; /* physical address */
/* get size of video memory; this is special for the JAZZ hardware */
mem = (r4030_read_reg32(JAZZ_R4030_CONFIG) >> 8) & 3;
--
2.24.1

Subject: Re: [PATCH v2 1/3] fbdev/g364fb: Fix build failure



On 2/7/20 12:01 AM, Finn Thain wrote:
> This patch resolves these compiler errors and warnings --
>
> CC drivers/video/fbdev/g364fb.o
> drivers/video/fbdev/g364fb.c: In function 'g364fb_cursor':
> drivers/video/fbdev/g364fb.c:137:9: error: 'x' undeclared (first use in this function)
> drivers/video/fbdev/g364fb.c:137:9: note: each undeclared identifier is reported only once for each function it appears in
> drivers/video/fbdev/g364fb.c:137:7: error: implicit declaration of function 'fontwidth' [-Werror=implicit-function-declaration]
> drivers/video/fbdev/g364fb.c:137:23: error: 'p' undeclared (first use in this function)
> drivers/video/fbdev/g364fb.c:137:38: error: 'y' undeclared (first use in this function)
> drivers/video/fbdev/g364fb.c:137:7: error: implicit declaration of function 'fontheight' [-Werror=implicit-function-declaration]
> drivers/video/fbdev/g364fb.c: In function 'g364fb_init':
> drivers/video/fbdev/g364fb.c:233:24: error: 'fbvar' undeclared (first use in this function)
> drivers/video/fbdev/g364fb.c:234:24: error: 'xres' undeclared (first use in this function)
> drivers/video/fbdev/g364fb.c:201:14: warning: unused variable 'j' [-Wunused-variable]
> drivers/video/fbdev/g364fb.c:197:25: warning: unused variable 'pal_ptr' [-Wunused-variable]
>
> The MIPS Magnum framebuffer console now works when tested in QEMU.
>
> Cc: Bartlomiej Zolnierkiewicz <[email protected]>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
> Signed-off-by: Finn Thain <[email protected]>

Acked-by: Bartlomiej Zolnierkiewicz <[email protected]>

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

> ---
> drivers/video/fbdev/g364fb.c | 29 +++--------------------------
> 1 file changed, 3 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/video/fbdev/g364fb.c b/drivers/video/fbdev/g364fb.c
> index 845b79da2a7c..05837a3b985c 100644
> --- a/drivers/video/fbdev/g364fb.c
> +++ b/drivers/video/fbdev/g364fb.c
> @@ -108,7 +108,6 @@ static int g364fb_pan_display(struct fb_var_screeninfo *var,
> static int g364fb_setcolreg(u_int regno, u_int red, u_int green,
> u_int blue, u_int transp,
> struct fb_info *info);
> -static int g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor);
> static int g364fb_blank(int blank, struct fb_info *info);
>
> static const struct fb_ops g364fb_ops = {
> @@ -119,28 +118,8 @@ static const struct fb_ops g364fb_ops = {
> .fb_fillrect = cfb_fillrect,
> .fb_copyarea = cfb_copyarea,
> .fb_imageblit = cfb_imageblit,
> - .fb_cursor = g364fb_cursor,
> };
>
> -int g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
> -{
> -
> - switch (cursor->enable) {
> - case CM_ERASE:
> - *(unsigned int *) CTLA_REG |= CURS_TOGGLE;
> - break;
> -
> - case CM_MOVE:
> - case CM_DRAW:
> - *(unsigned int *) CTLA_REG &= ~CURS_TOGGLE;
> - *(unsigned int *) CURS_POS_REG =
> - ((x * fontwidth(p)) << 12) | ((y * fontheight(p)) -
> - info->var.yoffset);
> - break;
> - }
> - return 0;
> -}
> -
> /*
> * Pan or Wrap the Display
> *
> @@ -194,11 +173,9 @@ static int g364fb_setcolreg(u_int regno, u_int red, u_int green,
> */
> int __init g364fb_init(void)
> {
> - volatile unsigned int *pal_ptr =
> - (volatile unsigned int *) CLR_PAL_REG;
> volatile unsigned int *curs_pal_ptr =
> (volatile unsigned int *) CURS_PAL_REG;
> - int mem, i, j;
> + int mem, i;
>
> if (fb_get_options("g364fb", NULL))
> return -ENODEV;
> @@ -230,8 +207,8 @@ int __init g364fb_init(void)
> */
> *(unsigned short *) (CURS_PAT_REG + 14 * 64) = 0xffff;
> *(unsigned short *) (CURS_PAT_REG + 15 * 64) = 0xffff;
> - fb_var.xres_virtual = fbvar.xres;
> - fb_fix.line_length = (xres / 8) * fb_var.bits_per_pixel;
> + fb_var.xres_virtual = fb_var.xres;
> + fb_fix.line_length = fb_var.xres_virtual * fb_var.bits_per_pixel / 8;
> fb_fix.smem_start = 0x40000000; /* physical address */
> /* get size of video memory; this is special for the JAZZ hardware */
> mem = (r4030_read_reg32(JAZZ_R4030_CONFIG) >> 8) & 3;

2020-02-08 17:17:18

by Philippe Mathieu-Daudé

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] fbdev/g364fb: Fix build failure

On 2/7/20 12:01 AM, Finn Thain wrote:
> This patch resolves these compiler errors and warnings --
>
> CC drivers/video/fbdev/g364fb.o
> drivers/video/fbdev/g364fb.c: In function 'g364fb_cursor':
> drivers/video/fbdev/g364fb.c:137:9: error: 'x' undeclared (first use in this function)
> drivers/video/fbdev/g364fb.c:137:9: note: each undeclared identifier is reported only once for each function it appears in
> drivers/video/fbdev/g364fb.c:137:7: error: implicit declaration of function 'fontwidth' [-Werror=implicit-function-declaration]
> drivers/video/fbdev/g364fb.c:137:23: error: 'p' undeclared (first use in this function)
> drivers/video/fbdev/g364fb.c:137:38: error: 'y' undeclared (first use in this function)
> drivers/video/fbdev/g364fb.c:137:7: error: implicit declaration of function 'fontheight' [-Werror=implicit-function-declaration]
> drivers/video/fbdev/g364fb.c: In function 'g364fb_init':
> drivers/video/fbdev/g364fb.c:233:24: error: 'fbvar' undeclared (first use in this function)
> drivers/video/fbdev/g364fb.c:234:24: error: 'xres' undeclared (first use in this function)
> drivers/video/fbdev/g364fb.c:201:14: warning: unused variable 'j' [-Wunused-variable]
> drivers/video/fbdev/g364fb.c:197:25: warning: unused variable 'pal_ptr' [-Wunused-variable]
>
> The MIPS Magnum framebuffer console now works when tested in QEMU.
>
> Cc: Bartlomiej Zolnierkiewicz <[email protected]>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
> Signed-off-by: Finn Thain <[email protected]>
> ---
> drivers/video/fbdev/g364fb.c | 29 +++--------------------------
> 1 file changed, 3 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/video/fbdev/g364fb.c b/drivers/video/fbdev/g364fb.c
> index 845b79da2a7c..05837a3b985c 100644
> --- a/drivers/video/fbdev/g364fb.c
> +++ b/drivers/video/fbdev/g364fb.c
> @@ -108,7 +108,6 @@ static int g364fb_pan_display(struct fb_var_screeninfo *var,
> static int g364fb_setcolreg(u_int regno, u_int red, u_int green,
> u_int blue, u_int transp,
> struct fb_info *info);
> -static int g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor);
> static int g364fb_blank(int blank, struct fb_info *info);
>
> static const struct fb_ops g364fb_ops = {
> @@ -119,28 +118,8 @@ static const struct fb_ops g364fb_ops = {
> .fb_fillrect = cfb_fillrect,
> .fb_copyarea = cfb_copyarea,
> .fb_imageblit = cfb_imageblit,
> - .fb_cursor = g364fb_cursor,
> };
>
> -int g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
> -{
> -
> - switch (cursor->enable) {
> - case CM_ERASE:
> - *(unsigned int *) CTLA_REG |= CURS_TOGGLE;
> - break;
> -
> - case CM_MOVE:
> - case CM_DRAW:
> - *(unsigned int *) CTLA_REG &= ~CURS_TOGGLE;
> - *(unsigned int *) CURS_POS_REG =
> - ((x * fontwidth(p)) << 12) | ((y * fontheight(p)) -
> - info->var.yoffset);
> - break;
> - }
> - return 0;
> -}
> -
> /*
> * Pan or Wrap the Display
> *
> @@ -194,11 +173,9 @@ static int g364fb_setcolreg(u_int regno, u_int red, u_int green,
> */
> int __init g364fb_init(void)
> {
> - volatile unsigned int *pal_ptr =
> - (volatile unsigned int *) CLR_PAL_REG;
> volatile unsigned int *curs_pal_ptr =
> (volatile unsigned int *) CURS_PAL_REG;
> - int mem, i, j;
> + int mem, i;
>
> if (fb_get_options("g364fb", NULL))
> return -ENODEV;
> @@ -230,8 +207,8 @@ int __init g364fb_init(void)
> */
> *(unsigned short *) (CURS_PAT_REG + 14 * 64) = 0xffff;
> *(unsigned short *) (CURS_PAT_REG + 15 * 64) = 0xffff;
> - fb_var.xres_virtual = fbvar.xres;
> - fb_fix.line_length = (xres / 8) * fb_var.bits_per_pixel;
> + fb_var.xres_virtual = fb_var.xres;
> + fb_fix.line_length = fb_var.xres_virtual * fb_var.bits_per_pixel / 8;
> fb_fix.smem_start = 0x40000000; /* physical address */
> /* get size of video memory; this is special for the JAZZ hardware */
> mem = (r4030_read_reg32(JAZZ_R4030_CONFIG) >> 8) & 3;
>

Tested-by: Philippe Mathieu-Daudé <[email protected]>

2020-02-19 19:05:47

by Paul Burton

[permalink] [raw]
Subject: Re: [PATCH v2 0/3] Improve MIPS Magnum support

Hello,

Finn Thain wrote:
> A few minor patches are needed to more easily boot a MIPS Magnum build
> under QEMU. This series fixes a build failure in the g364fb driver and
> modifies jazz_defconfig for use with 'qemu-system-mips64el -M magnum'.
>
> Note that QEMU's dp8393x implementation has bugs, one of which prevents
> the Linux jazzsonic driver from probing the chip. I have fixed the bugs
> that I know of in a series of patches at,
> https://github.com/fthain/qemu/commits/sonic
>
> Changed since v1:
> - Added reviewed-by and tested-by tags from Philippe Mathieu-Daudé.
> - Rebased.
>
>
> Finn Thain (3):
> fbdev/g364fb: Fix build failure
> mips/jazz: Remove redundant settings and shrink jazz_defconfig
> mips/jazz: Update jazz_defconfig for MIPS Magnum

Series applied to mips-next.

> fbdev/g364fb: Fix build failure
> commit c584f9532115
> https://git.kernel.org/mips/c/c584f9532115
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
> Signed-off-by: Finn Thain <[email protected]>
> Acked-by: Bartlomiej Zolnierkiewicz <[email protected]>
> Tested-by: Philippe Mathieu-Daudé <[email protected]>
> Signed-off-by: Paul Burton <[email protected]>
>
> mips/jazz: Remove redundant settings and shrink jazz_defconfig
> commit a7047b8dd098
> https://git.kernel.org/mips/c/a7047b8dd098
>
> Tested-by: Philippe Mathieu-Daudé <[email protected]>
> Signed-off-by: Finn Thain <[email protected]>
> Signed-off-by: Paul Burton <[email protected]>
>
> mips/jazz: Update jazz_defconfig for MIPS Magnum
> commit 91f40e896444
> https://git.kernel.org/mips/c/91f40e896444
>
> Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
> Tested-by: Philippe Mathieu-Daudé <[email protected]>
> Signed-off-by: Finn Thain <[email protected]>
> Signed-off-by: Paul Burton <[email protected]>

Thanks,
Paul

[ This message was auto-generated; if you believe anything is incorrect
then please email [email protected] to report it. ]