diff --git a/arch/arm/dts/am335x-bone-common.dtsi b/arch/arm/dts/am335x-bone-common.dtsi index 40a3c35..5f9da95 100644 --- a/arch/arm/dts/am335x-bone-common.dtsi +++ b/arch/arm/dts/am335x-bone-common.dtsi @@ -14,7 +14,7 @@ }; chosen { - stdout-path = &uart0; + stdout-path = &uart4; tick-timer = &timer2; }; @@ -92,20 +92,27 @@ 0x17c (PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_rtsn.i2c2_scl */ >; }; - +#if 0 uart0_pins: pinmux_uart0_pins { pinctrl-single,pins = < 0x170 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */ 0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */ >; }; +#endif + uart4_pins: pinmux_uart4_pins { + pinctrl-single,pins = < + 0x11C (PIN_INPUT_PULLUP | MUX_MODE3) /* uart4rxd.uart0_rxd */ + 0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* uart4txd.uart0_txd */ + >; + }; clkout2_pin: pinmux_clkout2_pin { pinctrl-single,pins = < 0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr1.clkout2 */ >; }; - +#if 0 cpsw_default: cpsw_default { pinctrl-single,pins = < /* Slave 1 */ @@ -143,7 +150,7 @@ 0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7) >; }; - +#endif davinci_mdio_default: davinci_mdio_default { pinctrl-single,pins = < /* MDIO */ @@ -166,6 +173,7 @@ >; }; +#if 1 emmc_pins: pinmux_emmc_pins { pinctrl-single,pins = < 0x80 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */ @@ -180,14 +188,44 @@ 0x1c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad7.mmc1_dat7 */ >; }; +#endif + + nandflash_pins_s0: nandflash_pins_s0 { + pinctrl-single,pins = < + 0x0 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad0.gpmc_ad0 */ + 0x4 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad1.gpmc_ad1 */ + 0x8 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad2.gpmc_ad2 */ + 0xc (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad3.gpmc_ad3 */ + 0x10 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad4.gpmc_ad4 */ + 0x14 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad5.gpmc_ad5 */ + 0x18 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad6.gpmc_ad6 */ + 0x1c (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad7.gpmc_ad7 */ + 0x70 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_wait0.gpmc_wait0 */ + 0x74 (PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_wpn.gpio0_30 */ + 0x7c (PIN_OUTPUT | MUX_MODE0) /* gpmc_csn0.gpmc_csn0 */ + 0x90 (PIN_OUTPUT | MUX_MODE0) /* gpmc_advn_ale.gpmc_advn_ale */ + 0x94 (PIN_OUTPUT | MUX_MODE0) /* gpmc_oen_ren.gpmc_oen_ren */ + 0x98 (PIN_OUTPUT | MUX_MODE0) /* gpmc_wen.gpmc_wen */ + 0x9c (PIN_OUTPUT | MUX_MODE0) /* gpmc_be0n_cle.gpmc_be0n_cle */ + >; + }; + }; +#if 0 &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins>; status = "okay"; }; +#endif +&uart4 { + pinctrl-names = "default"; + pinctrl-0 = <&uart4_pins>; + + status = "okay"; +}; &usb { status = "okay"; @@ -369,13 +407,14 @@ phy-mode = "mii"; }; +#if 0 &mac { pinctrl-names = "default", "sleep"; pinctrl-0 = <&cpsw_default>; pinctrl-1 = <&cpsw_sleep>; status = "okay"; }; - +#endif &davinci_mdio { pinctrl-names = "default", "sleep"; pinctrl-0 = <&davinci_mdio_default>; @@ -391,6 +430,88 @@ cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; }; +&gpmc { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&nandflash_pins_s0>; + ranges = <0 0 0x08000000 0x1000000>; /* CS0: 16MB for NAND */ + nand@0,0 { + reg = <0 0 4>; /* CS0, offset 0, IO size 4 */ + ti,nand-ecc-opt = "bch8"; + ti,elm-id = <&elm>; + nand-bus-width = <8>; + gpmc,device-width = <1>; + gpmc,sync-clk-ps = <0>; + gpmc,cs-on-ns = <0>; + gpmc,cs-rd-off-ns = <44>; + gpmc,cs-wr-off-ns = <44>; + gpmc,adv-on-ns = <6>; + gpmc,adv-rd-off-ns = <34>; + gpmc,adv-wr-off-ns = <44>; + gpmc,we-on-ns = <0>; + gpmc,we-off-ns = <40>; + gpmc,oe-on-ns = <0>; + gpmc,oe-off-ns = <54>; + gpmc,access-ns = <64>; + gpmc,rd-cycle-ns = <82>; + gpmc,wr-cycle-ns = <82>; + gpmc,wait-on-read = "true"; + gpmc,wait-on-write = "true"; + gpmc,bus-turnaround-ns = <0>; + gpmc,cycle2cycle-delay-ns = <0>; + gpmc,clk-activation-ns = <0>; + gpmc,wait-monitoring-ns = <0>; + gpmc,wr-access-ns = <40>; + gpmc,wr-data-mux-bus-ns = <0>; + /* MTD partition table */ + /* All SPL-* partitions are sized to minimal length + * which can be independently programmable. For + * NAND flash this is equal to size of erase-block */ + #address-cells = <1>; + #size-cells = <1>; + partition@0 { + label = "NAND.SPL"; + reg = <0x00000000 0x000020000>; + }; + partition@1 { + label = "NAND.SPL.backup1"; + reg = <0x00020000 0x00020000>; + }; + partition@2 { + label = "NAND.SPL.backup2"; + reg = <0x00040000 0x00020000>; + }; + partition@3 { + label = "NAND.SPL.backup3"; + reg = <0x00060000 0x00020000>; + }; + partition@4 { + label = "NAND.u-boot-spl-os"; + reg = <0x00080000 0x00040000>; + }; + partition@5 { + label = "NAND.u-boot"; + reg = <0x000C0000 0x00100000>; + }; + partition@6 { + label = "NAND.u-boot-env"; + reg = <0x001C0000 0x00020000>; + }; + partition@7 { + label = "NAND.u-boot-env.backup1"; + reg = <0x001E0000 0x00020000>; + }; + partition@8 { + label = "NAND.kernel"; + reg = <0x00200000 0x00800000>; + }; + partition@9 { + label = "NAND.file-system"; + reg = <0x00A00000 0x0F600000>; + }; + }; +}; + &aes { status = "okay"; }; diff --git a/arch/arm/dts/am335x-boneblack.dts b/arch/arm/dts/am335x-boneblack.dts index 27ebe4a..7c02a26 100644 --- a/arch/arm/dts/am335x-boneblack.dts +++ b/arch/arm/dts/am335x-boneblack.dts @@ -14,7 +14,7 @@ model = "TI AM335x BeagleBone Black"; compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; chosen { - stdout-path = &uart0; + stdout-path = &uart4; tick-timer = &timer2; }; }; @@ -29,6 +29,7 @@ vmmc-supply = <&vmmcsd_fixed>; }; +#if 0 &mmc2 { vmmc-supply = <&vmmcsd_fixed>; pinctrl-names = "default"; @@ -36,7 +37,7 @@ bus-width = <8>; status = "okay"; }; - +#endif &am33xx_pinmux { nxp_hdmi_bonelt_pins: nxp_hdmi_bonelt_pins { diff --git a/board/ti/am335x/board.h b/board/ti/am335x/board.h index e13fcff..0eb1e9a 100644 --- a/board/ti/am335x/board.h +++ b/board/ti/am335x/board.h @@ -26,48 +26,48 @@ static inline int board_is_bone(void) { - return board_ti_is("A335BONE"); + return 0;/*board_ti_is("A335BONE");*/ } static inline int board_is_bone_lt(void) { - return board_ti_is("A335BNLT"); + return 1;/*board_ti_is("A335BNLT");*/ } static inline int board_is_bbg1(void) { - return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BBG1", 4); + return 0;/*board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BBG1", 4);*/ } static inline int board_is_beaglebonex(void) { - return board_is_bone() || board_is_bone_lt() || board_is_bbg1(); + return 0;/*board_is_bone() || board_is_bone_lt() || board_is_bbg1();*/ } static inline int board_is_evm_sk(void) { - return board_ti_is("A335X_SK"); + return 0;/*board_ti_is("A335X_SK"); } static inline int board_is_idk(void) { - return !strncmp(board_ti_get_config(), "SKU#02", 6); + return 0;/*!strncmp(board_ti_get_config(), "SKU#02", 6);*/ } static inline int board_is_gp_evm(void) { - return board_ti_is("A33515BB"); + return 0;/*board_ti_is("A33515BB");*/ } static inline int board_is_evm_15_or_later(void) { - return (board_is_gp_evm() && - strncmp("1.5", board_ti_get_rev(), 3) <= 0); + return 0;/*(board_is_gp_evm() && + strncmp("1.5", board_ti_get_rev(), 3) <= 0);*/ } static inline int board_is_icev2(void) { - return board_ti_is("A335_ICE") && !strncmp("2", board_ti_get_rev(), 1); + return 0;/*board_ti_is("A335_ICE") && !strncmp("2", board_ti_get_rev(), 1);*/ } /* @@ -84,4 +84,5 @@ void enable_uart4_pin_mux(void); void enable_uart5_pin_mux(void); void enable_i2c0_pin_mux(void); void enable_board_pin_mux(void); +void Enable_LCD_Power(void); #endif diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c index ad85b3a..470a1dc 100644 --- a/board/ti/am335x/mux.c +++ b/board/ti/am335x/mux.c @@ -47,15 +47,20 @@ static struct module_pin_mux uart3_pin_mux[] = { }; static struct module_pin_mux uart4_pin_mux[] = { - {OFFSET(gpmc_wait0), (MODE(6) | PULLUP_EN | RXACTIVE)}, /* UART4_RXD */ - {OFFSET(gpmc_wpn), (MODE(6) | PULLUDEN)}, /* UART4_TXD */ - {-1}, + {OFFSET(mii1_txd3), (MODE(3) | PULLUP_EN | RXACTIVE)}, /* UART4_RXD */ + {OFFSET(mii1_txd2), (MODE(3) | PULLUDEN)}, /* UART4_TXD */ + {-1}, }; static struct module_pin_mux uart5_pin_mux[] = { +#if 0 {OFFSET(lcd_data9), (MODE(4) | PULLUP_EN | RXACTIVE)}, /* UART5_RXD */ {OFFSET(lcd_data8), (MODE(4) | PULLUDEN)}, /* UART5_TXD */ {-1}, +#endif + {OFFSET(mii1_txd3), (MODE(3) | PULLUP_EN | RXACTIVE)}, /* UART4_RXD */ + {OFFSET(mii1_txd2), (MODE(3) | PULLUDEN)}, /* UART4_TXD */ + {-1}, }; static struct module_pin_mux mmc0_pin_mux[] = { @@ -65,7 +70,7 @@ static struct module_pin_mux mmc0_pin_mux[] = { {OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT0 */ {OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CLK */ {OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CMD */ - {OFFSET(mcasp0_aclkr), (MODE(4) | RXACTIVE)}, /* MMC0_WP */ +// {OFFSET(mcasp0_aclkr), (MODE(4) | RXACTIVE)}, /* MMC0_WP */ {OFFSET(spi0_cs1), (MODE(7) | RXACTIVE | PULLUP_EN)}, /* GPIO0_6 */ {-1}, }; @@ -77,7 +82,8 @@ static struct module_pin_mux mmc0_no_cd_pin_mux[] = { {OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT0 */ {OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CLK */ {OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CMD */ - {OFFSET(mcasp0_aclkr), (MODE(4) | RXACTIVE)}, /* MMC0_WP */ +// {OFFSET(mcasp0_aclkr), (MODE(4) | RXACTIVE)}, /* MMC0_WP */ + {OFFSET(spi0_cs1), (MODE(5) | RXACTIVE | PULLUP_EN)}, /* MMC0_CD */ {-1}, }; @@ -262,6 +268,13 @@ static struct module_pin_mux uart3_icev2_pin_mux[] = { {-1}, }; +static struct module_pin_mux LCD_pin_mux[] = { + {OFFSET(mii1_col),(MODE(7))},/*GPIO3_0*/ + {OFFSET(mii1_crs),(MODE(7))},/*GPIO3_3*/ + {OFFSET(mii1_txen),(MODE(7))},/*GPIO3_3*/ + {-1}, +}; + #if defined(CONFIG_NOR_BOOT) void enable_norboot_pin_mux(void) { @@ -304,6 +317,21 @@ void enable_i2c0_pin_mux(void) configure_module_pin_mux(i2c0_pin_mux); } diff --git a/board/ti/common/board_detect.c b/board/ti/common/board_detect.c index 854141e..1209db9 100644 --- a/board/ti/common/board_detect.c +++ b/board/ti/common/board_detect.c @@ -235,6 +235,9 @@ int __maybe_unused ti_i2c_eeprom_dra7_get(int bus_addr, int dev_addr) bool __maybe_unused board_ti_is(char *name_tag) { struct ti_common_eeprom *ep = TI_EEPROM_DATA; + + if(!strncmp(name_tag,"A335X_SK",8)); + return true; if (ep->header == TI_DEAD_EEPROM_MAGIC) return false; diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig index db64406..fd802b3 100644 --- a/configs/am335x_evm_defconfig +++ b/configs/am335x_evm_defconfig @@ -13,9 +13,9 @@ CONFIG_SPL=y CONFIG_SPL_STACK_R=y CONFIG_SPL_MTD_SUPPORT=y CONFIG_SPL_MUSB_NEW_SUPPORT=y -CONFIG_SPL_NET_SUPPORT=y +CONFIG_SPL_NET_SUPPORT=n CONFIG_SPL_USB_GADGET_SUPPORT=y -CONFIG_SPL_USBETH_SUPPORT=y +CONFIG_SPL_USBETH_SUPPORT=n CONFIG_SPL_OS_BOOT=y # CONFIG_CMD_IMLS is not set CONFIG_CMD_ASKENV=y @@ -62,4 +62,5 @@ CONFIG_OF_LIBFDT=y CONFIG_OF_BOARD_SETUP=y CONFIG_DM_NAND=y CONFIG_SPL_NET_VCI_STRING="AM335x U-Boot SPL" -CONFIG_SPL_ETH_SUPPORT=y +CONFIG_SPL_ETH_SUPPORT=n +CONFIG_CONS_INDEX=5 diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 4aa0004..03e6940 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -6,6 +6,7 @@ #ifndef _ASM_GENERIC_GPIO_H_ #define _ASM_GENERIC_GPIO_H_ +#include "../linux/types.h" /* * Generic GPIO API for U-Boot diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index bc1f2b2..9086f55 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -30,7 +30,7 @@ #define CONFIG_BOARD_LATE_INIT /* Clock Defines */ -#define V_OSCK 24000000 /* Clock output from T2 */ +#define V_OSCK 19200000 /* Clock output from T2 */ #define V_SCLK (V_OSCK) /* Custom script for NOR */ @@ -88,7 +88,7 @@ func(NAND, nand, 0) \ func(PXE, pxe, na) \ func(DHCP, dhcp, na) - +#if 1 #define CONFIG_BOOTCOMMAND \ "if test ${boot_fit} -eq 1; then " \ "run update_to_fit;" \ @@ -98,6 +98,12 @@ "run envboot; " \ "run distro_bootcmd" +#endif + +#if 0 +#define CONFIG_BOOTCOMMAND \ + "run nandboot" +#endif #include #ifndef CONFIG_SPL_BUILD @@ -111,8 +117,8 @@ "bootpart=0:2\0" \ "bootdir=/boot\0" \ "bootfile=zImage\0" \ - "fdtfile=undefined\0" \ - "console=ttyO0,115200n8\0" \ + "fdtfile=am335x-boneblack.dtb\0" \ + "console=ttyO4,115200n8\0" \ "partitions=" \ "uuid_disk=${uuid_gpt_disk};" \ "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \ @@ -160,7 +166,7 @@ "if test $board_name = A335_ICE; then "\ "setenv console ttyO3,115200n8;" \ "else " \ - "setenv console ttyO0,115200n8;" \ + "setenv console ttyO4,115200n8;" \ "fi;\0" \ NANDARGS \ NETARGS \ @@ -230,7 +236,7 @@ "128k(NAND.SPL.backup2)," \ "128k(NAND.SPL.backup3)," \ "256k(NAND.u-boot-spl-os)," \ - "1m(NAND.u-boot)," \ + "4m(NAND.u-boot)," \ "128k(NAND.u-boot-env)," \ "128k(NAND.u-boot-env.backup1)," \ "8m(NAND.kernel)," \ diff --git a/include/configs/ti_am335x_common.h b/include/configs/ti_am335x_common.h index 809d015..545a500 100644 --- a/include/configs/ti_am335x_common.h +++ b/include/configs/ti_am335x_common.h @@ -37,7 +37,7 @@ #define CONFIG_MII /* Required in net/eth.c */ #endif -#define CONFIG_DRIVER_TI_CPSW /* Driver for IP block */ +#undef CONFIG_DRIVER_TI_CPSW /* Driver for IP block */ /* * RTC related defines. To use bootcount you must set bootlimit in the * environment to a non-zero value and enable CONFIG_BOOTCOUNT_LIMIT