board: Add Microchip PIC32MZ[DA]-Starter-Kit board.
PATCH v2 7/13 board: Add Microchip PIC32MZ[DA]-Starter-Kit board.
This adds support for Microchip PIC32MZ[DA] Starter Kit board based on a PIC32MZ[DA] family of microcontroller.
---
Changes in v2:
- move CONFIG_SYS_TEXT_BASE (from board/<>/config.mk) to include/configs/<board>.h
arch/mips/dts/Makefile | 2 +- arch/mips/dts/pic32mzda_sk.dts | 38 +++++++++++++ arch/mips/mach-pic32/Kconfig | 7 +++ board/microchip/pic32mzda/Kconfig | 13 +++++ board/microchip/pic32mzda/MAINTAINERS | 6 ++ board/microchip/pic32mzda/Makefile | 7 +++ board/microchip/pic32mzda/README | 22 ++++++++ board/microchip/pic32mzda/pic32mzda.c | 31 +++++++++++ configs/pic32mzdask_defconfig | 21 +++++++ include/configs/pic32mzdask.h | 100 ++++++++++++++++++++++++++++++++++ 10 files changed, 246 insertions(+), 1 deletion(-) create mode 100644 arch/mips/dts/pic32mzda_sk.dts create mode 100644 board/microchip/pic32mzda/Kconfig create mode 100644 board/microchip/pic32mzda/MAINTAINERS create mode 100644 board/microchip/pic32mzda/Makefile create mode 100644 board/microchip/pic32mzda/README create mode 100644 board/microchip/pic32mzda/pic32mzda.c create mode 100644 configs/pic32mzdask_defconfig create mode 100644 include/configs/pic32mzdask.h
arch/mips/dts/Makefile +1 -1
@@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0+ # -dtb-y += +dtb-$(CONFIG_TARGET_PIC32MZDASK) += pic32mzda_sk.dtb targets += $(dtb-y)
arch/mips/dts/pic32mzda_sk.dts new file +38 -0
@@ -0,0 +1,38 @@ +/* + * Copyright (C) 2015 Purna Chandra Mandal, purna.mandal at microchip.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/dts-v1/; + +#include "pic32mzda.dtsi" + +/ { + model = "Microchip PIC32MZDASK"; + compatible = "microchip,pic32mzdask", "microchip,pic32mzda"; + + aliases { + console = &uart2; + serial0 = &uart2; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&clock { + status = "okay"; + u-boot,dm-pre-reloc; +}; + +&pinctrl { + status = "okay"; + u-boot,dm-pre-reloc; +}; + +&uart2 { + status = "okay"; + u-boot,dm-pre-reloc; +};
arch/mips/mach-pic32/Kconfig +7 -0
@@ -26,6 +26,13 @@ endchoice choice prompt "Board select" +config TARGET_PIC32MZDASK + bool "Microchip PIC32MZ[DA] Starter Kit" + depends on SOC_PIC32MZDA + help + This supports Microchip PIC32MZ[DA] Starter Kit. + endchoice +source "board/microchip/pic32mzda/Kconfig" endmenu
board/microchip/pic32mzda/Kconfig new file +13 -0
@@ -0,0 +1,13 @@ + +if TARGET_PIC32MZDASK + +config SYS_BOARD + default "pic32mzda" + +config SYS_VENDOR + default "microchip" + +config SYS_CONFIG_NAME + default "pic32mzdask" + +endif
board/microchip/pic32mzda/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +PIC32MZDASK BOARD +M: Purna Chandra Mandal <[email protected]> +S: Maintained +F: board/microchip/pic32mzda/ +F: include/configs/pic32mzdask.h +F: configs/pic32mzdask_defconfig
board/microchip/pic32mzda/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# (C) Copyright 2015 +# Purna Chandra Mandal, purna.mandal at microchip.com. +# +# SPDX-License-Identifier: GPL-2.0+ +# +obj-y := pic32mzda.o
board/microchip/pic32mzda/README new file +22 -0
@@ -0,0 +1,22 @@ +/* + * (c) 2015 Purna Chandra Mandal <[email protected]> + */ + +PIC32MZ[DA] Starter Kit +---------------------------------------- +PIC32MZ[DA] Starter Kit is based on PIC32MZ[DA] family of micro-controller. +This family is powered by MIPS M14KEC 32bit general purpose core and has +advanced microcontroller features and peripherals. + +This processor boots with proprietary stage1 bootloader running from internal +boot-flash. Stage1 bootloader inturns locates and jumps to U-Boot programmed +on internal program-flash. Finally U-Boot loads OS image (along with other +required files for booting) from either uSD card, or ethernet, or from USB +storage. + +To boot Linux following three files are mandatory - uEnv.txt (custom U-Boot +environment file), uImage, *.dtb (platform device-tree-blob file). + +U-Boot jumps to Linux using UHI specification. + +Visit http://microchip.com for details.
board/microchip/pic32mzda/pic32mzda.c new file +31 -0
@@ -0,0 +1,31 @@ +/* +* Microchip PIC32MZ[DA] Starter Kit board +* +* Copyright (C) 2015, Microchip Technology Inc. +* Purna Chandra Mandal <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +* +*/ + +#include <common.h> +#include <dm.h> +#include <clk.h> +#include <mach/pic32.h> + +#ifdef CONFIG_DISPLAY_BOARDINFO +int checkboard (void ) +{ +ulong rate =0 ; +struct udevice *dev; + +printf ("Core: %s\n" ,get_core_name ()); + +if (!uclass_get_device (UCLASS_CLK ,0 , &dev)) { + rate =clk_get_rate (dev); +printf ("CPU Speed: %lu MHz\n" , rate /1000000 ); + } + +return 0 ; +} +#endif
configs/pic32mzdask_defconfig new file +21 -0
@@ -0,0 +1,21 @@ +CONFIG_MIPS=y +CONFIG_MACH_PIC32=y +CONFIG_SOC_PIC32MZDA=y +CONFIG_TARGET_PIC32MZDASK=y +CONFIG_SYS_LITTLE_ENDIAN=y +CONFIG_HUSH_PARSER=y +CONFIG_SYS_HUSH_PARSER=y +CONFIG_SYS_PROMPT="dask # " +CONFIG_CMD_TIME=y +# CONFIG_CMD_IMLS is not set +CONFIG_SUPPORT_OF_CONTROL=y +CONFIG_OF_EMBED=y +CONFIG_DEFAULT_DEVICE_TREE="pic32mzda_sk" +CONFIG_DM=y +CONFIG_CMD_DM=y +CONFIG_DM_SERIAL=y +CONFIG_PIC32_SERIAL=y +CONFIG_CLK=y +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_FULL is not set +CONFIG_PIC32_PINCTRL=y
include/configs/pic32mzdask.h new file +100 -0
100 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH v2 7/13 board: Add Microchip PIC32MZ[DA]-Starter-Kit board.
2016-01-04 15:01 GMT+01:00 Purna Chandra Mandal <[email protected]>:
Quoted 231 lines
This adds support for Microchip PIC32MZ[DA] Starter Kit board based on a PIC32MZ[DA] family of microcontroller.
Signed-off-by Purna Chandra Mandal <[email protected]>---
Changes in v2:
- moveCONFIG_SYS_TEXT_BASE(from board/<>/config.mk) to include/configs/<board>.harch/mips/dts/Makefile | 2 +- arch/mips/dts/pic32mzda_sk.dts | 38 +++++++++++++ arch/mips/mach-pic32/Kconfig | 7 +++ board/microchip/pic32mzda/Kconfig | 13 +++++ board/microchip/pic32mzda/MAINTAINERS | 6 ++ board/microchip/pic32mzda/Makefile | 7 +++ board/microchip/pic32mzda/README | 22 ++++++++ board/microchip/pic32mzda/pic32mzda.c | 31 +++++++++++ configs/pic32mzdask_defconfig | 21 +++++++ include/configs/pic32mzdask.h | 100 ++++++++++++++++++++++++++++++++++ 10 files changed, 246 insertions(+), 1 deletion(-) create mode 100644 arch/mips/dts/pic32mzda_sk.dts create mode 100644 board/microchip/pic32mzda/Kconfig create mode 100644 board/microchip/pic32mzda/MAINTAINERS create mode 100644 board/microchip/pic32mzda/Makefile create mode 100644 board/microchip/pic32mzda/README create mode 100644 board/microchip/pic32mzda/pic32mzda.c create mode 100644 configs/pic32mzdask_defconfig create mode 100644 include/configs/pic32mzdask.harch/mips/dts/Makefile +1
-1@@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0+ # -dtb-y += +dtb-$(CONFIG_TARGET_PIC32MZDASK) += pic32mzda_sk.dtb targets += $(dtb-y)arch/mips/dts/pic32mzda_sk.dts new file +38
-0@@ -0,0 +1,38 @@ +/* + * Copyright (C) 2015 Purna Chandra Mandal, purna.mandal at microchip.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/dts-v1/; + +#include "pic32mzda.dtsi" + +/ { + model = "Microchip PIC32MZDASK"; + compatible = "microchip,pic32mzdask", "microchip,pic32mzda"; + + aliases { + console = &uart2; + serial0 = &uart2; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&clock { + status = "okay"; + u-boot,dm-pre-reloc; +}; + +&pinctrl { + status = "okay"; + u-boot,dm-pre-reloc; +}; + +&uart2 { + status = "okay"; + u-boot,dm-pre-reloc; +};arch/mips/mach-pic32/Kconfig +7
-0@@ -26,6 +26,13 @@ endchoice choice prompt "Board select" +config TARGET_PIC32MZDASK + bool "Microchip PIC32MZ[DA] Starter Kit" + depends on SOC_PIC32MZDA + help + This supports Microchip PIC32MZ[DA] Starter Kit. + endchoice +source "board/microchip/pic32mzda/Kconfig" endmenuboard/microchip/pic32mzda/Kconfig new file +13
-0@@ -0,0 +1,13 @@ + +if TARGET_PIC32MZDASK + +config SYS_BOARD + default "pic32mzda" + +config SYS_VENDOR + default "microchip" + +config SYS_CONFIG_NAME + default "pic32mzdask" + +endifboard/microchip/pic32mzda/MAINTAINERS new file +6
-0@@ -0,0 +1,6 @@ +PIC32MZDASK BOARD +M: Purna Chandra Mandal <[email protected]> +S: Maintained +F: board/microchip/pic32mzda/ +F: include/configs/pic32mzdask.h +F: configs/pic32mzdask_defconfigboard/microchip/pic32mzda/Makefile new file +7
-0@@ -0,0 +1,7 @@ +# +# (C) Copyright 2015 +# Purna Chandra Mandal, purna.mandal at microchip.com. +# +# SPDX-License-Identifier: GPL-2.0+ +# +obj-y := pic32mzda.oboard/microchip/pic32mzda/README new file +22
-0@@ -0,0 +1,22 @@ +/* + * (c) 2015 Purna Chandra Mandal <[email protected]> + */ + +PIC32MZ[DA] Starter Kit +---------------------------------------- +PIC32MZ[DA] Starter Kit is based on PIC32MZ[DA] family of micro-controller. +This family is powered by MIPS M14KEC 32bit general purpose core and has +advanced microcontroller features and peripherals. + +This processor boots with proprietary stage1 bootloader running from internal +boot-flash. Stage1 bootloader inturns locates and jumps to U-Boot programmed +on internal program-flash. Finally U-Boot loads OS image (along with other +required files for booting) from either uSD card, or ethernet, or from USB +storage. + +To boot Linux following three files are mandatory - uEnv.txt (custom U-Boot +environment file), uImage, *.dtb (platform device-tree-blob file). + +U-Boot jumps to Linux using UHI specification. + +Visit http://microchip.com for details.board/microchip/pic32mzda/pic32mzda.c new file +31
-0@@ -0,0 +1,31 @@ +/* +* Microchip PIC32MZ[DA] Starter Kit board +* +* Copyright (C) 2015, Microchip Technology Inc. +* Purna Chandra Mandal <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +* +*/ + +#include <common.h> +#include <dm.h> +#include <clk.h> +#include <mach/pic32.h> + +#ifdef CONFIG_DISPLAY_BOARDINFO +int checkboard (void ) +{ +ulong rate =0 ; +struct udevice *dev; + +printf ("Core: %s\n" ,get_core_name ()); + +if (!uclass_get_device (UCLASS_CLK ,0 , &dev)) { + rate =clk_get_rate (dev); +printf ("CPU Speed: %lu MHz\n" , rate /1000000 ); + } + +return 0 ; +} +#endif configs/pic32mzdask_defconfig new file +11
-0@@ -0,0 +1,21 @@ +CONFIG_MIPS=y +CONFIG_MACH_PIC32=y +CONFIG_SOC_PIC32MZDA=y +CONFIG_TARGET_PIC32MZDASK=y +CONFIG_SYS_LITTLE_ENDIAN=y +CONFIG_HUSH_PARSER=y +CONFIG_SYS_HUSH_PARSER=y +CONFIG_SYS_PROMPT="dask # " +CONFIG_CMD_TIME=y +# CONFIG_CMD_IMLS is not set +CONFIG_SUPPORT_OF_CONTROL=y
configs/pic32mzdask_defconfig line 21
Quoted 10 lines
configs/pic32mzdask_defconfig new file +10
-0+CONFIG_OF_EMBED=y +CONFIG_DEFAULT_DEVICE_TREE="pic32mzda_sk" +CONFIG_DM=y +CONFIG_CMD_DM=y +CONFIG_DM_SERIAL=y +CONFIG_PIC32_SERIAL=y +CONFIG_CLK=y +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_FULL is not set +CONFIG_PIC32_PINCTRL=y
this looks written by hand. Please create this file with Kconfig:
make savedefconfig
cp defconfig configs/pic32mzdask_defconfig
Quoted 20 lines
include/configs/pic32mzdask.h new file +14
-0@@ -0,0 +1,100 @@ +/* +* (c) 2015 Purna Chandra Mandal <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +* +* Microchip PIC32MZ[DA] Starter Kit. +*/ + +#ifndef __PIC32MZDASK_CONFIG_H +#define __PIC32MZDASK_CONFIG_H + +/* System Configuration */ +#define CONFIG_SYS_TEXT_BASE 0x9d004000/* .text */ +#define CONFIG_DISPLAY_BOARDINFO
include/configs/pic32mzdask.h line 24
Quoted 10 lines
include/configs/pic32mzdask.h new file +10
-0+ +/*-------------------------------------------- +* CPU configuration +*/ +/* CPU Timer rate */ +#define CONFIG_SYS_MIPS_TIMER_FREQ 100000000 + +/* Cache Configuration */ +#define CONFIG_SYS_MIPS_CACHE_MODE CONF_CM_CACHABLE_NONCOHERENT +#undef CONFIG_SKIP_LOWLEVEL_INIT
you do not need to add #undef lines to disable config options. All options are disabled by default.
Quoted 6 lines
include/configs/pic32mzdask.h new file +6
-0+ +/*---------------------------------------------------------------------- +* Memory Layout +*/ +#define CONFIG_SYS_SRAM_BASE 0x80000000 +#define CONFIG_SYS_SRAM_SIZE 0x00080000/* 512K */
include/configs/pic32mzdask.h line 40
Quoted 10 lines
include/configs/pic32mzdask.h new file +10
-0+ +/* Initial RAM for temporary stack, global data */ +#define CONFIG_SYS_INIT_RAM_SIZE 0x10000 +#define CONFIG_SYS_INIT_RAM_ADDR \ + (CONFIG_SYS_SRAM_BASE + CONFIG_SYS_SRAM_SIZE - CONFIG_SYS_INIT_RAM_SIZE) +#define CONFIG_SYS_GBL_DATA_OFFSET \ + (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET +#define CONFIG_SYS_INIT_SP_ADDR \ + (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
you do not need to take care of GENERATED_GBL_DATA_SIZE. This is automatically done in start.S. You only need to set:
#define CONFIG_SYS_INIT_RAM_SIZE 0x10000
#define CONFIG_SYS_INIT_RAM_ADDR \
(CONFIG_SYS_SRAM_BASE + CONFIG_SYS_SRAM_SIZE - CONFIG_SYS_INIT_RAM_SIZE)
#define CONFIG_SYS_INIT_SP_ADDR \
(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE - 1)
Quoted 64 lines
include/configs/pic32mzdask.h new file +60
-1+ +/* SDRAM Configuration (for final code, data, stack, heap) */ +#define CONFIG_SYS_SDRAM_BASE 0x88000000 +#define CONFIG_SYS_MALLOC_LEN (256 << 10) +#define CONFIG_SYS_BOOTPARAMS_LEN (4 << 10) +#define CONFIG_STACKSIZE (4 << 10)/* regular stack */ + +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE +#define CONFIG_SYS_MONITOR_LEN (192 << 10) + +#define CONFIG_SYS_LOAD_ADDR 0x88500000/* default load address */ +#define CONFIG_SYS_ENV_ADDR 0x88300000 + +/* Memory Test */ +#define CONFIG_SYS_MEMTEST_START 0x88000000 +#define CONFIG_SYS_MEMTEST_END 0x88080000 + +/*---------------------------------------------------------------------- +* Commands +*/ +#define CONFIG_SYS_LONGHELP /* undef to save memory */ +#define CONFIG_CMD_CLK +#define CONFIG_CMD_MEMTEST +#define CONFIG_CMD_MEMINFO + +/*------------------------------------------------- +* FLASH configuration +*/ +#define CONFIG_SYS_NO_FLASH + +/*------------------------------------------------------------ +* Console Configuration +*/ +#define CONFIG_BAUDRATE 115200 +#define CONFIG_SYS_BAUDRATE_TABLE {9600, 19200, 38400, 57600, 115200} +#define CONFIG_SYS_CBSIZE 1024/* Console I/O Buffer Size */ +#define CONFIG_SYS_MAXARGS 16/* max number of command args*/ +#define CONFIG_SYS_PBSIZE \ + (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) +#define CONFIG_CMDLINE_EDITING 1 + +/* +* Handover flattened device tree (dtb file) to Linux kernel +*/ +#define CONFIG_OF_LIBFDT 1 + +/* ------------------------------------------------- +* Environment +*/ +#define CONFIG_ENV_IS_NOWHERE 1 +#define CONFIG_ENV_SIZE 0x4000 + +/* --------------------------------------------------------------------- +* Board boot configuration +*/ +#define CONFIG_TIMESTAMP /* Print image info with timestamp */ +#define CONFIG_BOOTDELAY 5/* autoboot after X seconds */ +#undef CONFIG_BOOTARGS + +#endif /* __PIC32MZDASK_CONFIG_H */ --1.8.3.1
Signature · 1 line
- Daniel
PATCH v2 7/13 board: Add Microchip PIC32MZ[DA]-Starter-Kit board.
Quoted 244 lines · Daniel Schwierzeck
2016-01-04 15:01 GMT+01:00 Purna Chandra Mandal <[email protected]>:
Quoted 231 lines
This adds support for Microchip PIC32MZ[DA] Starter Kit board based on a PIC32MZ[DA] family of microcontroller.
Signed-off-by Purna Chandra Mandal <[email protected]>---
Changes in v2:
- moveCONFIG_SYS_TEXT_BASE(from board/<>/config.mk) to include/configs/<board>.harch/mips/dts/Makefile | 2 +- arch/mips/dts/pic32mzda_sk.dts | 38 +++++++++++++ arch/mips/mach-pic32/Kconfig | 7 +++ board/microchip/pic32mzda/Kconfig | 13 +++++ board/microchip/pic32mzda/MAINTAINERS | 6 ++ board/microchip/pic32mzda/Makefile | 7 +++ board/microchip/pic32mzda/README | 22 ++++++++ board/microchip/pic32mzda/pic32mzda.c | 31 +++++++++++ configs/pic32mzdask_defconfig | 21 +++++++ include/configs/pic32mzdask.h | 100 ++++++++++++++++++++++++++++++++++ 10 files changed, 246 insertions(+), 1 deletion(-) create mode 100644 arch/mips/dts/pic32mzda_sk.dts create mode 100644 board/microchip/pic32mzda/Kconfig create mode 100644 board/microchip/pic32mzda/MAINTAINERS create mode 100644 board/microchip/pic32mzda/Makefile create mode 100644 board/microchip/pic32mzda/README create mode 100644 board/microchip/pic32mzda/pic32mzda.c create mode 100644 configs/pic32mzdask_defconfig create mode 100644 include/configs/pic32mzdask.harch/mips/dts/Makefile +1
-1@@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0+ # -dtb-y += +dtb-$(CONFIG_TARGET_PIC32MZDASK) += pic32mzda_sk.dtb targets += $(dtb-y)arch/mips/dts/pic32mzda_sk.dts new file +38
-0@@ -0,0 +1,38 @@ +/* + * Copyright (C) 2015 Purna Chandra Mandal, purna.mandal at microchip.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/dts-v1/; + +#include "pic32mzda.dtsi" + +/ { + model = "Microchip PIC32MZDASK"; + compatible = "microchip,pic32mzdask", "microchip,pic32mzda"; + + aliases { + console = &uart2; + serial0 = &uart2; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&clock { + status = "okay"; + u-boot,dm-pre-reloc; +}; + +&pinctrl { + status = "okay"; + u-boot,dm-pre-reloc; +}; + +&uart2 { + status = "okay"; + u-boot,dm-pre-reloc; +};arch/mips/mach-pic32/Kconfig +7
-0@@ -26,6 +26,13 @@ endchoice choice prompt "Board select" +config TARGET_PIC32MZDASK + bool "Microchip PIC32MZ[DA] Starter Kit" + depends on SOC_PIC32MZDA + help + This supports Microchip PIC32MZ[DA] Starter Kit. + endchoice +source "board/microchip/pic32mzda/Kconfig" endmenuboard/microchip/pic32mzda/Kconfig new file +13
-0@@ -0,0 +1,13 @@ + +if TARGET_PIC32MZDASK + +config SYS_BOARD + default "pic32mzda" + +config SYS_VENDOR + default "microchip" + +config SYS_CONFIG_NAME + default "pic32mzdask" + +endifboard/microchip/pic32mzda/MAINTAINERS new file +6
-0@@ -0,0 +1,6 @@ +PIC32MZDASK BOARD +M: Purna Chandra Mandal <[email protected]> +S: Maintained +F: board/microchip/pic32mzda/ +F: include/configs/pic32mzdask.h +F: configs/pic32mzdask_defconfigboard/microchip/pic32mzda/Makefile new file +7
-0@@ -0,0 +1,7 @@ +# +# (C) Copyright 2015 +# Purna Chandra Mandal, purna.mandal at microchip.com. +# +# SPDX-License-Identifier: GPL-2.0+ +# +obj-y := pic32mzda.oboard/microchip/pic32mzda/README new file +22
-0@@ -0,0 +1,22 @@ +/* + * (c) 2015 Purna Chandra Mandal <[email protected]> + */ + +PIC32MZ[DA] Starter Kit +---------------------------------------- +PIC32MZ[DA] Starter Kit is based on PIC32MZ[DA] family of micro-controller. +This family is powered by MIPS M14KEC 32bit general purpose core and has +advanced microcontroller features and peripherals. + +This processor boots with proprietary stage1 bootloader running from internal +boot-flash. Stage1 bootloader inturns locates and jumps to U-Boot programmed +on internal program-flash. Finally U-Boot loads OS image (along with other +required files for booting) from either uSD card, or ethernet, or from USB +storage. + +To boot Linux following three files are mandatory - uEnv.txt (custom U-Boot +environment file), uImage, *.dtb (platform device-tree-blob file). + +U-Boot jumps to Linux using UHI specification. + +Visit http://microchip.com for details.board/microchip/pic32mzda/pic32mzda.c new file +31
-0@@ -0,0 +1,31 @@ +/* +* Microchip PIC32MZ[DA] Starter Kit board +* +* Copyright (C) 2015, Microchip Technology Inc. +* Purna Chandra Mandal <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +* +*/ + +#include <common.h> +#include <dm.h> +#include <clk.h> +#include <mach/pic32.h> + +#ifdef CONFIG_DISPLAY_BOARDINFO +int checkboard (void ) +{ +ulong rate =0 ; +struct udevice *dev; + +printf ("Core: %s\n" ,get_core_name ()); + +if (!uclass_get_device (UCLASS_CLK ,0 , &dev)) { + rate =clk_get_rate (dev); +printf ("CPU Speed: %lu MHz\n" , rate /1000000 ); + } + +return 0 ; +} +#endif configs/pic32mzdask_defconfig new file +11
-0@@ -0,0 +1,21 @@ +CONFIG_MIPS=y +CONFIG_MACH_PIC32=y +CONFIG_SOC_PIC32MZDA=y +CONFIG_TARGET_PIC32MZDASK=y +CONFIG_SYS_LITTLE_ENDIAN=y +CONFIG_HUSH_PARSER=y +CONFIG_SYS_HUSH_PARSER=y +CONFIG_SYS_PROMPT="dask # " +CONFIG_CMD_TIME=y +# CONFIG_CMD_IMLS is not set +CONFIG_SUPPORT_OF_CONTROL=yconfigs/pic32mzdask_defconfig line 21
Quoted 10 lines
configs/pic32mzdask_defconfig new file +10
-0+CONFIG_OF_EMBED=y +CONFIG_DEFAULT_DEVICE_TREE="pic32mzda_sk" +CONFIG_DM=y +CONFIG_CMD_DM=y +CONFIG_DM_SERIAL=y +CONFIG_PIC32_SERIAL=y +CONFIG_CLK=y +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_FULL is not set +CONFIG_PIC32_PINCTRL=ythis looks written by hand. Please create this file with
Kconfig:
Quoted 2 lines
make savedefconfig
cp defconfig configs/pic32mzdask_defconfig
Yes it is edited. I'll directly use kconfig generated one.
Quoted 24 lines
Quoted 24 lines
include/configs/pic32mzdask.h new file +18
-0@@ -0,0 +1,100 @@ +/* +* (c) 2015 Purna Chandra Mandal <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +* +* Microchip PIC32MZ[DA] Starter Kit. +*/ + +#ifndef __PIC32MZDASK_CONFIG_H +#define __PIC32MZDASK_CONFIG_H + +/* System Configuration */ +#define CONFIG_SYS_TEXT_BASE 0x9d004000/* .text */ +#define CONFIG_DISPLAY_BOARDINFO + +/*-------------------------------------------- +* CPU configuration +*/
Quoted 8 lines
include/configs/pic32mzdask.h line 24
Quoted 6 lines
include/configs/pic32mzdask.h new file +6
-0+/* CPU Timer rate */ +#define CONFIG_SYS_MIPS_TIMER_FREQ 100000000 + +/* Cache Configuration */ +#define CONFIG_SYS_MIPS_CACHE_MODE CONF_CM_CACHABLE_NONCOHERENT +#undef CONFIG_SKIP_LOWLEVEL_INITyou do not need to add #undef lines to disable config options. All options are disabled by default.
ack. Will remove.
Quoted 19 lines
Quoted 6 lines
include/configs/pic32mzdask.h new file +6
-0+ +/*---------------------------------------------------------------------- +* Memory Layout +*/ +#define CONFIG_SYS_SRAM_BASE 0x80000000 +#define CONFIG_SYS_SRAM_SIZE 0x00080000/* 512K */ include/configs/pic32mzdask.h line 40
Quoted 10 lines
include/configs/pic32mzdask.h new file +10
-0+ +/* Initial RAM for temporary stack, global data */ +#define CONFIG_SYS_INIT_RAM_SIZE 0x10000 +#define CONFIG_SYS_INIT_RAM_ADDR \ + (CONFIG_SYS_SRAM_BASE + CONFIG_SYS_SRAM_SIZE - CONFIG_SYS_INIT_RAM_SIZE) +#define CONFIG_SYS_GBL_DATA_OFFSET \ + (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET +#define CONFIG_SYS_INIT_SP_ADDR \ + (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)you do not need to take care of
GENERATED_GBL_DATA_SIZE. This is automatically done instart.S. You only need to set:
Quoted 5 lines
#define
CONFIG_SYS_INIT_RAM_SIZE0x10000
#defineCONFIG_SYS_INIT_RAM_ADDR\
(CONFIG_SYS_SRAM_BASE+CONFIG_SYS_SRAM_SIZE-CONFIG_SYS_INIT_RAM_SIZE)
#defineCONFIG_SYS_INIT_SP_ADDR\
(CONFIG_SYS_INIT_RAM_ADDR+CONFIG_SYS_INIT_RAM_SIZE- 1)
Good catch. Will remove.
Quoted 66 lines
Quoted 64 lines
include/configs/pic32mzdask.h new file +60
-1+ +/* SDRAM Configuration (for final code, data, stack, heap) */ +#define CONFIG_SYS_SDRAM_BASE 0x88000000 +#define CONFIG_SYS_MALLOC_LEN (256 << 10) +#define CONFIG_SYS_BOOTPARAMS_LEN (4 << 10) +#define CONFIG_STACKSIZE (4 << 10)/* regular stack */ + +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE +#define CONFIG_SYS_MONITOR_LEN (192 << 10) + +#define CONFIG_SYS_LOAD_ADDR 0x88500000/* default load address */ +#define CONFIG_SYS_ENV_ADDR 0x88300000 + +/* Memory Test */ +#define CONFIG_SYS_MEMTEST_START 0x88000000 +#define CONFIG_SYS_MEMTEST_END 0x88080000 + +/*---------------------------------------------------------------------- +* Commands +*/ +#define CONFIG_SYS_LONGHELP /* undef to save memory */ +#define CONFIG_CMD_CLK +#define CONFIG_CMD_MEMTEST +#define CONFIG_CMD_MEMINFO + +/*------------------------------------------------- +* FLASH configuration +*/ +#define CONFIG_SYS_NO_FLASH + +/*------------------------------------------------------------ +* Console Configuration +*/ +#define CONFIG_BAUDRATE 115200 +#define CONFIG_SYS_BAUDRATE_TABLE {9600, 19200, 38400, 57600, 115200} +#define CONFIG_SYS_CBSIZE 1024/* Console I/O Buffer Size */ +#define CONFIG_SYS_MAXARGS 16/* max number of command args*/ +#define CONFIG_SYS_PBSIZE \ + (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) +#define CONFIG_CMDLINE_EDITING 1 + +/* +* Handover flattened device tree (dtb file) to Linux kernel +*/ +#define CONFIG_OF_LIBFDT 1 + +/* ------------------------------------------------- +* Environment +*/ +#define CONFIG_ENV_IS_NOWHERE 1 +#define CONFIG_ENV_SIZE 0x4000 + +/* --------------------------------------------------------------------- +* Board boot configuration +*/ +#define CONFIG_TIMESTAMP /* Print image info with timestamp */ +#define CONFIG_BOOTDELAY 5/* autoboot after X seconds */ +#undef CONFIG_BOOTARGS + +#endif /* __PIC32MZDASK_CONFIG_H */ --1.8.3.1