[PATCH] console_simple: fix linking error when ARCH_HAS_CTRLC enabled

2019-10-15 Thread iu87m888m
From: DU HUANPENG 

this error happens in sandbox with simple console, sandbox
has ARCH_HAS_CTRLC enabled by default

$ make sandbox_defconfig
$ make menuconfig
(select CONFIG_SHELL_SIMPLE)
$ make

LD  barebox
common/built-in.o: In function `__pr_memory_display':
/home/du/source/barebox/common/memory_display.c:117: undefined reference to 
`ctrlc'
common/built-in.o: In function `run_init':
/home/du/source/barebox/common/startup.c:317: undefined reference to 
`console_ctrlc_allow'
common/built-in.o: In function `parse_stream_outer':
/home/du/source/barebox/common/hush.c:1742: undefined reference to `ctrlc'
common/built-in.o: In function `run_list_real':
/home/du/source/barebox/common/hush.c:895: undefined reference to `ctrlc'
common/built-in.o: In function `run_shell':
/home/du/source/barebox/common/hush.c:1940: undefined reference to 
`ctrlc_handled'

Signed-off-by: DU HUANPENG 
---
 common/console_simple.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/common/console_simple.c b/common/console_simple.c
index 010e0b3..6d293b2 100644
--- a/common/console_simple.c
+++ b/common/console_simple.c
@@ -64,16 +64,20 @@ void console_flush(void)
 }
 EXPORT_SYMBOL(console_flush);
 
-#ifndef ARCH_HAS_CTRLC
 void ctrlc_handled(void)
 {
 }
 /* test if ctrl-c was pressed */
 int ctrlc (void)
 {
+   int ret = 0;
+#ifdef ARCH_HAS_CTRLC
+   ret = arch_ctrlc();
+#else
if (tstc() && getchar() == 3)
-   return 1;
-   return 0;
+   ret = 1;
+#endif
+   return ret;
 }
 EXPORT_SYMBOL(ctrlc);
 
@@ -85,8 +89,6 @@ void console_ctrlc_forbid(void)
 {
 }
 
-#endif /* ARCH_HAS_CTRC */
-
 int console_register(struct console_device *newcdev)
 {
if (console)
-- 
2.7.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] fix compile error when set CONFIG_CONSOLE_SIMPLE=y

2019-10-03 Thread iu87m888m
From: DU HUANPENG 

Signed-off-by: DU HUANPENG 
---
 common/console_simple.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/common/console_simple.c b/common/console_simple.c
index 385da2f..010e0b3 100644
--- a/common/console_simple.c
+++ b/common/console_simple.c
@@ -65,6 +65,9 @@ void console_flush(void)
 EXPORT_SYMBOL(console_flush);
 
 #ifndef ARCH_HAS_CTRLC
+void ctrlc_handled(void)
+{
+}
 /* test if ctrl-c was pressed */
 int ctrlc (void)
 {
@@ -73,6 +76,15 @@ int ctrlc (void)
return 0;
 }
 EXPORT_SYMBOL(ctrlc);
+
+void console_ctrlc_allow(void)
+{
+}
+
+void console_ctrlc_forbid(void)
+{
+}
+
 #endif /* ARCH_HAS_CTRC */
 
 int console_register(struct console_device *newcdev)
-- 
2.7.4




___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] CONFIG_PBL_BREAK option is available for MIPS

2019-09-06 Thread iu87m888m
From: DU HUANPENG 

Signed-off-by: DU HUANPENG 
---
 common/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/Kconfig b/common/Kconfig
index 8aad5ba..a86b5e8 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1290,7 +1290,7 @@ config DEBUG_INITCALLS
 
 config PBL_BREAK
bool "Execute software break on pbl start"
-   depends on ARM
+   depends on ARM || MIPS
help
  If this enabled, barebox will be compiled with BKPT instruction
  on early pbl init. This option should be used only with JTAG debugger!
-- 
2.7.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] mtd: spi-nor: Add support for s25fl128s0 s25fl128s1 flashes from Linux

2019-08-28 Thread iu87m888m
From: DU HUANPENG 

These definitions are taken from Linux's spi-nor driver as of v5.2-rc4

Signed-off-by: DU HUANPENG 
---
 drivers/mtd/spi-nor/spi-nor.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index 9dbc830..f38db7c 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -736,6 +736,10 @@ static const struct spi_device_id spi_nor_ids[] = {
 */
{ "s25sl032p",  INFO(0x010215, 0x4d00,  64 * 1024,  64, 
SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "s25sl064p",  INFO(0x010216, 0x4d00,  64 * 1024, 128, 
SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+   { "s25fl128s0", INFO6(0x012018, 0x4d0080, 256 * 1024, 64,
+   SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
+   { "s25fl128s1", INFO6(0x012018, 0x4d0180, 64 * 1024, 256,
+   SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
{ "s25fl256s0", INFO(0x010219, 0x4d00, 256 * 1024, 128, 0) },
{ "s25fl256s1", INFO(0x010219, 0x4d01,  64 * 1024, 512, 
SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "s25fl512s",  INFO(0x010220, 0x4d00, 256 * 1024, 256, 
SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
-- 
2.7.4




___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] mtd: spi-nor: Add support for s25fl128s0 s25fl128s1 flashes from Linux

2019-08-28 Thread iu87m888m
From: DU HUANPENG 

These definitions are taken from Linux's spi-nor driver as of v5.2-rc4

Signed-off-by: DU HUANPENG 
---
 drivers/mtd/spi-nor/spi-nor.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index 9dbc830..f38db7c 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -736,6 +736,10 @@ static const struct spi_device_id spi_nor_ids[] = {
 */
{ "s25sl032p",  INFO(0x010215, 0x4d00,  64 * 1024,  64, 
SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "s25sl064p",  INFO(0x010216, 0x4d00,  64 * 1024, 128, 
SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+   { "s25fl128s0", INFO6(0x012018, 0x4d0080, 256 * 1024, 64,
+   SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
+   { "s25fl128s1", INFO6(0x012018, 0x4d0180, 64 * 1024, 256,
+   SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
{ "s25fl256s0", INFO(0x010219, 0x4d00, 256 * 1024, 128, 0) },
{ "s25fl256s1", INFO(0x010219, 0x4d01,  64 * 1024, 512, 
SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "s25fl512s",  INFO(0x010220, 0x4d00, 256 * 1024, 256, 
SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
-- 
2.7.4




___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] mtd: spi-nor: Add support for s25fl128s0 s25fl128s1 flashes from Linux

2019-08-28 Thread iu87m888m
From: DU HUANPENG 

These definitions are taken from Linux's spi-nor driver as of v5.2-rc4

Signed-off-by: DU HUANPENG 
---
 drivers/mtd/spi-nor/spi-nor.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index 9dbc830..f38db7c 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -736,6 +736,10 @@ static const struct spi_device_id spi_nor_ids[] = {
 */
{ "s25sl032p",  INFO(0x010215, 0x4d00,  64 * 1024,  64, 
SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "s25sl064p",  INFO(0x010216, 0x4d00,  64 * 1024, 128, 
SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+   { "s25fl128s0", INFO6(0x012018, 0x4d0080, 256 * 1024, 64,
+   SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
+   { "s25fl128s1", INFO6(0x012018, 0x4d0180, 64 * 1024, 256,
+   SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
{ "s25fl256s0", INFO(0x010219, 0x4d00, 256 * 1024, 128, 0) },
{ "s25fl256s1", INFO(0x010219, 0x4d01,  64 * 1024, 512, 
SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "s25fl512s",  INFO(0x010220, 0x4d00, 256 * 1024, 256, 
SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
-- 
2.7.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox