Skip to contentSkip to conversation

Apparent conflict between CONFIG_BLK and CONFIG_API

U-Boot fuz at fuz.su 3 participants 5 messages Mar 7, 2017 – Apr 9, 2017

lore
Share & tools
lore
#0 lore raw

Good evening,

I am trying to port FreeBSD to the ASUS Tinker Board, a computer based on the Rockchip 3288 SoC. FreeBSD's boot loader (named loader(8)) needs CONFIG_API to be enabled, but trying to build an U-Boot from trunk with both CONFIG_API and CONFIG_BLK (as required for Rockchip SoC's?) leads to the following build failure:

$ CROSS_COMPILE=arm-none-eabi- gmake tinker-rk3288_defconfig all
...
  CC      api/api_storage.o
api/api_storage.c: In function 'dev_read_stor':
api/api_storage.c:334:9: error: 'struct blk_desc' has no member named 'block_read'
  if ((dd->block_read) == NULL) {
         ^~
api/api_storage.c:339:11: error: 'struct blk_desc' has no member named 'block_read'
  return dd->block_read(dd, start, len, buf);
           ^~
api/api_storage.c:340:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
gmake[2]: *** [scripts/Makefile.build:281: api/api_storage.o] Fehler 1
gmake[1]: *** [Makefile:1229: api] Fehler 2
gmake: *** [Makefile:460: __build_one_by_one] Error 2

I applied the following fix, but the product doesn't boot. Perhaps that's not a property of the fix though:

api/api_storage.c +4 -0
index e80818df1c..815ed1128d 100644
@@ -331,10 +331,14 @@ lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start
        if (!dev_stor_is_valid(type, dd))
                return 0;
 
+#ifdef CONFIG_BLK
+       return blk_dread(dd, start, len, buf);
+#else
        if ((dd->block_read) == NULL) {
                debugf("no block_read() for device 0x%08x\n", cookie);
                return 0;
        }
 
        return dd->block_read(dd, start, len, buf);
+#endif /* defined(CONFIG_BLK) */
 }

Yours,
Robert Clausecker

Signature · 2 lines
()  ascii ribbon campaign - for an 8-bit clean world 
/\  - against html email  - against proprietary attachments
#1 lore raw

Hi,

Quoted 36 lines · On 7 March 2017 at 14:53, <[email protected]> wrote:

Good evening,

I am trying to port FreeBSD to the ASUS Tinker Board, a computer based on the Rockchip 3288 SoC. FreeBSD's boot loader (named loader(8)) needs CONFIG_API to be enabled, but trying to build an U-Boot from trunk with both CONFIG_API and CONFIG_BLK (as required for Rockchip SoC's?) leads to the following build failure:

$ CROSS_COMPILE=arm-none-eabi- gmake tinker-rk3288_defconfig all
...
  CC      api/api_storage.o
api/api_storage.c: In function 'dev_read_stor':
api/api_storage.c:334:9: error: 'struct blk_desc' has no member named 'block_read'
  if ((dd->block_read) == NULL) {
         ^~
api/api_storage.c:339:11: error: 'struct blk_desc' has no member named 'block_read'
  return dd->block_read(dd, start, len, buf);
           ^~
api/api_storage.c:340:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
gmake[2]: *** [scripts/Makefile.build:281: api/api_storage.o] Fehler 1
gmake[1]: *** [Makefile:1229: api] Fehler 2
gmake: *** [Makefile:460: __build_one_by_one] Error 2

I applied the following fix, but the product doesn't boot. Perhaps that's not a property of the fix though:

api/api_storage.c +0 -0
index e80818df1c..815ed1128d 100644
@@ -331,10 +331,14 @@ lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start
        if (!dev_stor_is_valid(type, dd))
                return 0;
 

api/api_storage.c lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start · line 343

Quoted 10 lines
api/api_storage.c +4 -0
+#ifdef CONFIG_BLK
+       return blk_dread(dd, start, len, buf);
+#else
        if ((dd->block_read) == NULL) {
                debugf("no block_read() for device 0x%08x\n", cookie);
                return 0;
        }
 
        return dd->block_read(dd, start, len, buf);
+#endif /* defined(CONFIG_BLK) */

This fix looks right to me. There may be something else wrong. I have not used API very much but it might be worth checking if the board boots OK without CONFIG_BLK?

Quoted 5 lines
api/api_storage.c +0 -0
 }

Yours,
Robert Clausecker

Quoted 7 lines

--
() ascii ribbon campaign - for an 8-bit clean world /\ - against html email - against proprietary attachments
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

Regards,
Simon

#2 lore raw

Hello Simon,

CONFIG_BLK is set by default for all Rockchip boards. Turning it off was the first thing I tried, but I actually wasn't able to figure out how to turn it off at all and was then advised elsewhere that this is probably not a good idea either.

Yours,
Robert Clausecker

Quoted 69 lines · Simon Glass

Hi,

Quoted 36 lines · On 7 March 2017 at 14:53, <[email protected]> wrote:

Good evening,

I am trying to port FreeBSD to the ASUS Tinker Board, a computer based on the Rockchip 3288 SoC. FreeBSD's boot loader (named loader(8)) needs CONFIG_API to be enabled, but trying to build an U-Boot from trunk with both CONFIG_API and CONFIG_BLK (as required for Rockchip SoC's?) leads to the following build failure:

$ CROSS_COMPILE=arm-none-eabi- gmake tinker-rk3288_defconfig all
...
  CC      api/api_storage.o
api/api_storage.c: In function 'dev_read_stor':
api/api_storage.c:334:9: error: 'struct blk_desc' has no member named 'block_read'
  if ((dd->block_read) == NULL) {
         ^~
api/api_storage.c:339:11: error: 'struct blk_desc' has no member named 'block_read'
  return dd->block_read(dd, start, len, buf);
           ^~
api/api_storage.c:340:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
gmake[2]: *** [scripts/Makefile.build:281: api/api_storage.o] Fehler 1
gmake[1]: *** [Makefile:1229: api] Fehler 2
gmake: *** [Makefile:460: __build_one_by_one] Error 2

I applied the following fix, but the product doesn't boot. Perhaps that's not a property of the fix though:

api/api_storage.c +0 -0
index e80818df1c..815ed1128d 100644
@@ -331,10 +331,14 @@ lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start
        if (!dev_stor_is_valid(type, dd))
                return 0;
 

api/api_storage.c lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start · line 343

Quoted 10 lines
api/api_storage.c +4 -0
+#ifdef CONFIG_BLK
+       return blk_dread(dd, start, len, buf);
+#else
        if ((dd->block_read) == NULL) {
                debugf("no block_read() for device 0x%08x\n", cookie);
                return 0;
        }
 
        return dd->block_read(dd, start, len, buf);
+#endif /* defined(CONFIG_BLK) */

This fix looks right to me. There may be something else wrong. I have not used API very much but it might be worth checking if the board boots OK without CONFIG_BLK?

Quoted 5 lines
api/api_storage.c +0 -0
 }

Yours,
Robert Clausecker

Quoted 7 lines

--
() ascii ribbon campaign - for an 8-bit clean world /\ - against html email - against proprietary attachments
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

Regards,
Simon

Signature · 2 lines
()  ascii ribbon campaign - for an 8-bit clean world 
/\  - against html email  - against proprietary attachments
#3 lore raw

Hi Robert,

Quoted 6 lines · On 13 March 2017 at 07:51, <[email protected]> wrote:

Hello Simon,

CONFIG_BLK is set by default for all Rockchip boards. Turning it off was the first thing I tried, but I actually wasn't able to figure out how to turn it off at all and was then advised elsewhere that this is probably not a good idea either.

This means that you don't have an easy baseline. My suggest would be to put debugging in the API functions within U-Boot and see if you can work out where it is going wrong.

Regards,
Simon

Quoted 78 lines

Yours,
Robert Clausecker

Quoted 67 lines · Simon Glass

Hi,

Quoted 36 lines · On 7 March 2017 at 14:53, <[email protected]> wrote:

Good evening,

I am trying to port FreeBSD to the ASUS Tinker Board, a computer based on the Rockchip 3288 SoC. FreeBSD's boot loader (named loader(8)) needs CONFIG_API to be enabled, but trying to build an U-Boot from trunk with both CONFIG_API and CONFIG_BLK (as required for Rockchip SoC's?) leads to the following build failure:

$ CROSS_COMPILE=arm-none-eabi- gmake tinker-rk3288_defconfig all
...
  CC      api/api_storage.o
api/api_storage.c: In function 'dev_read_stor':
api/api_storage.c:334:9: error: 'struct blk_desc' has no member named 'block_read'
  if ((dd->block_read) == NULL) {
         ^~
api/api_storage.c:339:11: error: 'struct blk_desc' has no member named 'block_read'
  return dd->block_read(dd, start, len, buf);
           ^~
api/api_storage.c:340:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
gmake[2]: *** [scripts/Makefile.build:281: api/api_storage.o] Fehler 1
gmake[1]: *** [Makefile:1229: api] Fehler 2
gmake: *** [Makefile:460: __build_one_by_one] Error 2

I applied the following fix, but the product doesn't boot. Perhaps that's not a property of the fix though:

api/api_storage.c +0 -0
index e80818df1c..815ed1128d 100644
@@ -331,10 +331,14 @@ lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start
        if (!dev_stor_is_valid(type, dd))
                return 0;
 

api/api_storage.c lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start · line 343

Quoted 10 lines
api/api_storage.c +4 -0
+#ifdef CONFIG_BLK
+       return blk_dread(dd, start, len, buf);
+#else
        if ((dd->block_read) == NULL) {
                debugf("no block_read() for device 0x%08x\n", cookie);
                return 0;
        }
 
        return dd->block_read(dd, start, len, buf);
+#endif /* defined(CONFIG_BLK) */

This fix looks right to me. There may be something else wrong. I have not used API very much but it might be worth checking if the board boots OK without CONFIG_BLK?

Quoted 5 lines
api/api_storage.c +0 -0
 }

Yours,
Robert Clausecker

Quoted 7 lines

--
() ascii ribbon campaign - for an 8-bit clean world /\ - against html email - against proprietary attachments
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

Quoted 2 lines

Regards,
Simon

--
() ascii ribbon campaign - for an 8-bit clean world /\ - against html email - against proprietary attachments

#4 lore raw
In reply to fuz at fuz.su

api/api_storage.c

Quoted 34 lines · fuz at fuz.su

Good evening,

I am trying to port FreeBSD to the ASUS Tinker Board, a computer based on the Rockchip 3288 SoC. FreeBSD's boot loader (named loader(8)) needs CONFIG_API to be enabled, but trying to build an U-Boot from trunk with both CONFIG_API and CONFIG_BLK (as required for Rockchip SoC's?) leads to the following build failure:

$ CROSS_COMPILE=arm-none-eabi- gmake tinker-rk3288_defconfig all
...
  CC      api/api_storage.o
api/api_storage.c: In function 'dev_read_stor':
api/api_storage.c:334:9: error: 'struct blk_desc' has no member named 'block_read'
  if ((dd->block_read) == NULL) {
         ^~
api/api_storage.c:339:11: error: 'struct blk_desc' has no member named 'block_read'
  return dd->block_read(dd, start, len, buf);
           ^~
api/api_storage.c:340:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
gmake[2]: *** [scripts/Makefile.build:281: api/api_storage.o] Fehler 1
gmake[1]: *** [Makefile:1229: api] Fehler 2
gmake: *** [Makefile:460: __build_one_by_one] Error 2

I applied the following fix, but the product doesn't boot. Perhaps that's not a property of the fix though:

Yours,
Robert Clausecker

api/api_storage.c +0 -0
index e80818df1c..815ed1128d 100644

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170408/8a9a643c/attachment.sig>