Skip to contentSkip to conversation

arm: mvebu: sata_mv: Add bootstd hook to enable sata_bootdev

PATCH In review Tony Dinh 3 participants 7 messages Sep 6, 2023 – Oct 16, 2023 libata

lore
Share & tools
lore

Tony Dinh

author
#0 lore raw

PATCH 1/1 arm: mvebu: sata_mv: Add bootstd hook to enable sata_bootdev

Add hook in sata_mv probe to enable bootstd bootdev.

Note: bootdev_setup_for_sibling_blk() invocation is a noop if bootsd is not enabled for ahci sata yet.

---

 drivers/ata/sata_mv.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/ata/sata_mv.c +7 -1
index 18c7a66db1..55a5365b5a 100644
@@ -34,6 +34,7 @@
 #include <common.h>
 #include <ahci.h>
 #include <blk.h>
+#include <bootdev.h>
 #include <cpu_func.h>
 #include <dm.h>
 #include <log.h>
@@ -1104,6 +1105,12 @@ static int sata_mv_probe(struct udevice *dev)
 			/* TODO: undo create */
 			continue;
 
+		ret = bootdev_setup_for_sibling_blk(blk, "sata_bootdev");
+		if (ret) {
+			printf("%s: Failed to create bootdev\n", __func__);
+			continue;
+		}
+
 		/* If we got here, the current SATA port was probed
 		 * successfully, so set the probe status to successful.
 		 */
@@ -1116,7 +1123,6 @@ static int sata_mv_probe(struct udevice *dev)
 static int sata_mv_scan(struct udevice *dev)
 {
 	/* Nothing to do here */
-
 	return 0;
 }
 
Signature · 1 line
2.39.2
author
#1 lore raw

Hi Stefan,

In case you forgot, please review this patch!

Thanks,
Tony

Quoted 48 lines · Tony Dinh

Add hook in sata_mv probe to enable bootstd bootdev.

Note: bootdev_setup_for_sibling_blk() invocation is a noop if bootsd is not enabled for ahci sata yet.

---

 drivers/ata/sata_mv.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/ata/sata_mv.c +7 -2
index 18c7a66db1..55a5365b5a 100644
@@ -34,6 +34,7 @@
 #include <common.h>
 #include <ahci.h>
 #include <blk.h>
+#include <bootdev.h>
 #include <cpu_func.h>
 #include <dm.h>
 #include <log.h>
@@ -1104,6 +1105,12 @@ static int sata_mv_probe(struct udevice *dev)
                        /* TODO: undo create */
                        continue;
 
+               ret = bootdev_setup_for_sibling_blk(blk, "sata_bootdev");
+               if (ret) {
+                       printf("%s: Failed to create bootdev\n", __func__);
+                       continue;
+               }
+
                /* If we got here, the current SATA port was probed
                 * successfully, so set the probe status to successful.
                 */
@@ -1116,7 +1123,6 @@ static int sata_mv_probe(struct udevice *dev)
 static int sata_mv_scan(struct udevice *dev)
 {
        /* Nothing to do here */
-
        return 0;
 }
 
--

2.39.2

Reviewed-by on v1 1/1
#2 lore raw
In reply to Tony Dinh

Hi Tony,

Quoted 12 lines · Tony Dinh

Add hook in sata_mv probe to enable bootstd bootdev.

Note: bootdev_setup_for_sibling_blk() invocation is a noop if bootsd is not enabled for ahci sata yet.

---

 drivers/ata/sata_mv.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

But please see below

Quoted 26 lines
drivers/ata/sata_mv.c +7 -0
index 18c7a66db1..55a5365b5a 100644
@@ -34,6 +34,7 @@
 #include <common.h>
 #include <ahci.h>
 #include <blk.h>
+#include <bootdev.h>
 #include <cpu_func.h>
 #include <dm.h>
 #include <log.h>
@@ -1104,6 +1105,12 @@ static int sata_mv_probe(struct udevice *dev)
                        /* TODO: undo create */
                        continue;
 
+               ret = bootdev_setup_for_sibling_blk(blk, "sata_bootdev");
+               if (ret) {
+                       printf("%s: Failed to create bootdev\n", __func__);
+                       continue;
+               }
+
                /* If we got here, the current SATA port was probed
                 * successfully, so set the probe status to successful.
                 */

drivers/ata/sata_mv.c static int sata_mv_probe(struct udevice *dev) · line 1119

Quoted 4 lines
drivers/ata/sata_mv.c +0 -1
@@ -1116,7 +1123,6 @@ static int sata_mv_probe(struct udevice *dev)
 static int sata_mv_scan(struct udevice *dev)
 {
        /* Nothing to do here */
-

You should leave this - the style is to put a newline before the final return in a function.

Quoted 6 lines
drivers/ata/sata_mv.c +0 -1
        return 0;
 }
 
--

2.39.2

Regards,
Simon

author
#3 lore raw

Hi Simon,

Quoted 46 lines · Simon Glass

Hi Tony,

Quoted 12 lines · Tony Dinh

Add hook in sata_mv probe to enable bootstd bootdev.

Note: bootdev_setup_for_sibling_blk() invocation is a noop if bootsd is not enabled for ahci sata yet.

---

 drivers/ata/sata_mv.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

But please see below

Quoted 25 lines
drivers/ata/sata_mv.c +7 -0
index 18c7a66db1..55a5365b5a 100644
@@ -34,6 +34,7 @@
 #include <common.h>
 #include <ahci.h>
 #include <blk.h>
+#include <bootdev.h>
 #include <cpu_func.h>
 #include <dm.h>
 #include <log.h>
@@ -1104,6 +1105,12 @@ static int sata_mv_probe(struct udevice *dev)
                        /* TODO: undo create */
                        continue;
 
+               ret = bootdev_setup_for_sibling_blk(blk, "sata_bootdev");
+               if (ret) {
+                       printf("%s: Failed to create bootdev\n", __func__);
+                       continue;
+               }
+
                /* If we got here, the current SATA port was probed
                 * successfully, so set the probe status to successful.
                 */
Quoted 8 lines

drivers/ata/sata_mv.c static int sata_mv_probe(struct udevice *dev) · line 1119

Quoted 5 lines
drivers/ata/sata_mv.c +0 -1
@@ -1116,7 +1123,6 @@ static int sata_mv_probe(struct udevice *dev)
 static int sata_mv_scan(struct udevice *dev)
 {
        /* Nothing to do here */
-

You should leave this - the style is to put a newline before the final return in a function.

Thanks,
Tony

Quoted 10 lines
Quoted 7 lines
drivers/ata/sata_mv.c +0 -1
        return 0;
 }
 
--

2.39.2

Regards,
Simon

Reviewed-by on v1 1/1
#4 lore raw
In reply to Tony Dinh
Quoted 6 lines · Tony Dinh

Add hook in sata_mv probe to enable bootstd bootdev.

Note: bootdev_setup_for_sibling_blk() invocation is a noop if bootsd is not enabled for ahci sata yet.

Thanks,
Stefan

Quoted 31 lines

---

  drivers/ata/sata_mv.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/ata/sata_mv.c +7 -0
index 18c7a66db1..55a5365b5a 100644
@@ -34,6 +34,7 @@
  #include <common.h>
  #include <ahci.h>
  #include <blk.h>
+#include <bootdev.h>
  #include <cpu_func.h>
  #include <dm.h>
  #include <log.h>
@@ -1104,6 +1105,12 @@ static int sata_mv_probe(struct udevice *dev)
  			/* TODO: undo create */
  			continue;
 
+		ret = bootdev_setup_for_sibling_blk(blk, "sata_bootdev");
+		if (ret) {
+			printf("%s: Failed to create bootdev\n", __func__);
+			continue;
+		}
+
  		/* If we got here, the current SATA port was probed
  		 * successfully, so set the probe status to successful.
  		 */

drivers/ata/sata_mv.c static int sata_mv_probe(struct udevice *dev) · line 1128

Quoted 7 lines
drivers/ata/sata_mv.c +0 -1
@@ -1116,7 +1123,6 @@ static int sata_mv_probe(struct udevice *dev)
  static int sata_mv_scan(struct udevice *dev)
  {
  	/* Nothing to do here */
-
  	return 0;
  }
 

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
author
#5 lore raw

Thanks Stefan!

All the best,
Tony

Quoted 60 lines · Stefan Roese
Quoted 6 lines · Tony Dinh

Add hook in sata_mv probe to enable bootstd bootdev.

Note: bootdev_setup_for_sibling_blk() invocation is a noop if bootsd is not enabled for ahci sata yet.

Thanks,
Stefan

Quoted 31 lines

---

  drivers/ata/sata_mv.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/ata/sata_mv.c +7 -0
index 18c7a66db1..55a5365b5a 100644
@@ -34,6 +34,7 @@
  #include <common.h>
  #include <ahci.h>
  #include <blk.h>
+#include <bootdev.h>
  #include <cpu_func.h>
  #include <dm.h>
  #include <log.h>
@@ -1104,6 +1105,12 @@ static int sata_mv_probe(struct udevice *dev)
                      /* TODO: undo create */
                      continue;
 
+             ret = bootdev_setup_for_sibling_blk(blk, "sata_bootdev");
+             if (ret) {
+                     printf("%s: Failed to create bootdev\n", __func__);
+                     continue;
+             }
+
              /* If we got here, the current SATA port was probed
               * successfully, so set the probe status to successful.
               */

drivers/ata/sata_mv.c static int sata_mv_probe(struct udevice *dev) · line 1128

Quoted 7 lines
drivers/ata/sata_mv.c +0 -1
@@ -1116,7 +1123,6 @@ static int sata_mv_probe(struct udevice *dev)
  static int sata_mv_scan(struct udevice *dev)
  {
      /* Nothing to do here */
-
      return 0;
  }
 

Viele Grüße,
Stefan Roese

--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]

#6 lore raw
In reply to Stefan Roese
Quoted 9 lines · Stefan Roese
Quoted 6 lines · Tony Dinh

Add hook in sata_mv probe to enable bootstd bootdev.

Note: bootdev_setup_for_sibling_blk() invocation is a noop if bootsd is not enabled for ahci sata yet.

Applied to u-boot-marvell/master

Thanks,
Stefan

Quoted 34 lines

Thanks,
Stefan

Quoted 31 lines

---

  drivers/ata/sata_mv.c | 8 +++++++-

  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/ata/sata_mv.c +7 -0
index 18c7a66db1..55a5365b5a 100644
@@ -34,6 +34,7 @@
   #include <common.h>
   #include <ahci.h>
   #include <blk.h>
+#include <bootdev.h>
   #include <cpu_func.h>
   #include <dm.h>
   #include <log.h>
@@ -1104,6 +1105,12 @@ static int sata_mv_probe(struct udevice *dev)
               /* TODO: undo create */
               continue;
+        ret = bootdev_setup_for_sibling_blk(blk, "sata_bootdev");
+        if (ret) {
+            printf("%s: Failed to create bootdev\n", __func__);
+            continue;
+        }
+
           /* If we got here, the current SATA port was probed
            * successfully, so set the probe status to successful.
            */
@@ -1116,7 +1123,6 @@ static int sata_mv_probe(struct udevice *dev)
   static int sata_mv_scan(struct udevice *dev)
Quoted 9 lines

drivers/ata/sata_mv.c static int sata_mv_probe(struct udevice *dev) · line 1127

Quoted 5 lines
drivers/ata/sata_mv.c +0 -1
   {
       /* Nothing to do here */
-
       return 0;
   }

Viele Grüße,
Stefan Roese

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]