sunxi: Gigabit PHY support for SUN8I_EMAC
cover sunxi: Gigabit PHY support for SUN8I_EMAC
The sun8i_emac is a triple-speed Ethernet controller. This changeset adds support for negotiating links at gigabit speeds:
* enables CONFIG_PHY_GIGE
* enables support for the Micrel KSZ9031 GbE PHY
Separated out into two changes, as CONFIG_PHY_GIGE is needed with any GbE PHY for gigabit-operation. Bundled into a single changeset, as we test this with the KSZ9031 on our boards.
Klaus Goger (1):
sun8i: define CONFIG_PHY_GIGE for EMAC
Philipp Tomsich (1):
sun8i: enable support for the Micrel KSZ9031 with SUN8I_EMAC
include/configs/sunxi-common.h | 6 ++++++ 1 file changed, 6 insertions(+)
Signature · 1 line
1.9.1
PATCH 1/2 sun8i: define CONFIG_PHY_GIGE for EMAC
From: Klaus Goger <[email protected]>
CONFIG_PHY_GIGE needs to be defined for miiphy_speed to report correct speed.
--- include/configs/sunxi-common.h | 4 ++++ 1 file changed, 4 insertions(+)
include/configs/sunxi-common.h +4 -0
@@ -285,323 +285,327 @@ extern int soft_i2c_gpio_sda;extern int soft_i2c_gpio_scl;#endif #define CONFIG_VIDEO_LCD_I2C_BUS 0/* The lcd panel soft i2c is bus 0 */ #define CONFIG_SYS_SPD_BUS_NUM 1/* And the axp209 i2c bus is bus 1 */ #else #define CONFIG_SYS_SPD_BUS_NUM 0/* The axp209 i2c bus is bus 0 */ #define CONFIG_VIDEO_LCD_I2C_BUS -1/* NA, but necessary to compile */ #endif /* PMU */ #if definedCONFIG_AXP152_POWER || definedCONFIG_AXP209_POWER || \ definedCONFIG_AXP221_POWER || definedCONFIG_AXP818_POWER || \ definedCONFIG_SY8106A_POWER #endif #ifndef CONFIG_CONS_INDEX #define CONFIG_CONS_INDEX 1/* UART0 */ #endif #ifdef CONFIG_REQUIRE_SERIAL_CONSOLE #if CONFIG_CONS_INDEX ==1 #ifdef CONFIG_MACH_SUN9I #define OF_STDOUT_PATH "/soc/serial at 07000000:115200"#else #define OF_STDOUT_PATH "/soc at 01c00000/serial at 01c28000:115200"#endif #elif CONFIG_CONS_INDEX ==2 && defined(CONFIG_MACH_SUN5I )#define OF_STDOUT_PATH "/soc at 01c00000/serial at 01c28400:115200"#elif CONFIG_CONS_INDEX ==3 && defined(CONFIG_MACH_SUN6I )#define OF_STDOUT_PATH "/soc at 01c00000/serial at 01c28800:115200"#elif CONFIG_CONS_INDEX ==3 && defined(CONFIG_MACH_SUN8I )#define OF_STDOUT_PATH "/soc at 01c00000/serial at 01c28800:115200"#elif CONFIG_CONS_INDEX ==5 && defined(CONFIG_MACH_SUN8I )#define OF_STDOUT_PATH "/soc at 01c00000/serial at 01f02800:115200"#else #error Unsupported console port nr. Please fix stdout-path in sunxi-common.h.#endif #endif /* ifdef CONFIG_REQUIRE_SERIAL_CONSOLE */ /* GPIO */ #define CONFIG_SUNXI_GPIO #ifdef CONFIG_VIDEO /* * The amount of RAM to keep free at the top of RAM when relocating u-boot, * to use as framebuffer. This must be a multiple of 4096. */ #define CONFIG_SUNXI_MAX_FB_SIZE (16 << 20)/* Do we want to initialize a simple FB? */ #define CONFIG_VIDEO_DT_SIMPLEFB /* Fallback to old sunxi_video if the driver model video driver is disabled */ #ifndef CONFIG_VIDEO_SUNXI_DM #define CONFIG_VIDEO_SUNXI #endif #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_BMP_LOGO #define CONFIG_CMD_BMP #define CONFIG_SPLASH_SCREEN_ALIGN #define CONFIG_VIDEO_STD_TIMINGS #define CONFIG_I2C_EDID #define VIDEO_LINE_LEN (pGD->plnSizeX)/* allow both serial and cfb console. */ /* stop x86 thinking in cfbconsole from trying to init a pc keyboard */ #endif /* CONFIG_VIDEO */ /* Ethernet support */ #ifdef CONFIG_SUNXI_EMAC #define CONFIG_PHY_ADDR 1#define CONFIG_MII /* MII PHY management */ #define CONFIG_PHYLIB #endif #ifdef CONFIG_SUNXI_GMAC #define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ /* Cherry-pick from A80: #define CONFIG_PHY_ADDR 1 */ #define CONFIG_MII /* MII PHY management */ #define CONFIG_PHY_REALTEK #define CONFIG_PHY_MICREL #define CONFIG_PHY_MICREL_KSZ9031 #endif +#ifdef CONFIG_SUN8I_EMAC +#define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ +#endif +#ifdef CONFIG_USB_EHCI_HCD #define CONFIG_USB_OHCI_NEW #define CONFIG_USB_OHCI_SUNXI #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 1#endif #ifdef CONFIG_USB_MUSB_SUNXI #define CONFIG_USB_MUSB_PIO_ONLY #endif #ifdef CONFIG_USB_MUSB_GADGET #define CONFIG_USB_FUNCTION_MASS_STORAGE #endif #ifdef CONFIG_USB_FUNCTION_FASTBOOT #define CONFIG_FASTBOOT_BUF_SIZE 0x8000000#define CONFIG_SYS_BOOTM_LEN 0x1000000#define CONFIG_SUNXI_FASTBOOT_GPIO "PM7"#ifdef CONFIG_SUNXI_FASTBOOT_GPIO # define CONFIG_BOARD_LATE_INIT #endif #ifdef CONFIG_MMC #define CONFIG_FASTBOOT_FLASH_MMC_DEV 1#define CONFIG_EFI_PARTITION_ENTRIES_OFF 1024000#define CONFIG_RANDOM_UUID #endif #endif #ifdef CONFIG_USB_FUNCTION_MASS_STORAGE #endif #ifdef CONFIG_USB_KEYBOARD #define CONFIG_PREBOOT #define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE #endif #if !definedCONFIG_ENV_IS_IN_MMC && \ !definedCONFIG_ENV_IS_IN_NAND && \ !definedCONFIG_ENV_IS_IN_FAT && \ !definedCONFIG_ENV_IS_IN_SPI_FLASH #define CONFIG_ENV_IS_NOWHERE #endif #define CONFIG_MISC_INIT_R #ifndef CONFIG_SPL_BUILD #include <config_distro_defaults.h> #ifdef CONFIG_ARM64 /* * Boards seem to come with at least 512MB of DRAM. * The kernel should go at 512K, which is the default text offset (that will * be adjusted at runtime if needed). * There is no compression for arm64 kernels (yet), so leave some space * for really big kernels, say 256MB for now. * Scripts, PXE and DTBs should go afterwards, leaving the rest for the initrd. * Align the initrd to a 2MB page. */ #define KERNEL_ADDR_R __stringify(SDRAM_OFFSET(0080000))#define FDT_ADDR_R __stringify(SDRAM_OFFSET(FA00000))#define SCRIPT_ADDR_R __stringify(SDRAM_OFFSET(FC00000))#define PXEFILE_ADDR_R __stringify(SDRAM_OFFSET(FD00000))#define RAMDISK_ADDR_R __stringify(SDRAM_OFFSET(FE00000))#else /* * 160M RAM (256M minimum minus 64MB heap + 32MB for u-boot, stack, fb, etc. * 32M uncompressed kernel, 16M compressed kernel, 1M fdt, * 1M script, 1M pxe and the ramdisk at the end. */ #define KERNEL_ADDR_R __stringify(SDRAM_OFFSET(2000000))#define FDT_ADDR_R __stringify(SDRAM_OFFSET(3000000))#define SCRIPT_ADDR_R __stringify(SDRAM_OFFSET(3100000))#define PXEFILE_ADDR_R __stringify(SDRAM_OFFSET(3200000))#define RAMDISK_ADDR_R __stringify(SDRAM_OFFSET(3300000))#endif #define MEM_LAYOUT_ENV_SETTINGS \ "bootm_size=0xa000000\0" \ "kernel_addr_r=" KERNEL_ADDR_R "\0" \ "fdt_addr_r=" FDT_ADDR_R "\0" \ "scriptaddr=" SCRIPT_ADDR_R "\0" \ "pxefile_addr_r=" PXEFILE_ADDR_R "\0" \ "ramdisk_addr_r=" RAMDISK_ADDR_R "\0"#define DFU_ALT_INFO_RAM \ "dfu_alt_info_ram=" \ "kernel ram " KERNEL_ADDR_R " 0x1000000;" \ "fdt ram " FDT_ADDR_R " 0x100000;" \ "ramdisk ram " RAMDISK_ADDR_R " 0x4000000\0"#ifdef CONFIG_MMC #define BOOT_TARGET_DEVICES_MMC (func) func(MMC, mmc, 0)#if CONFIG_MMC_SUNXI_SLOT_EXTRA !=-1 #define BOOT_TARGET_DEVICES_MMC_EXTRA (func) func(MMC, mmc, 1)#else #define BOOT_TARGET_DEVICES_MMC_EXTRA (func)#endif #else #define BOOT_TARGET_DEVICES_MMC (func)#define BOOT_TARGET_DEVICES_MMC_EXTRA (func)#endif #ifdef CONFIG_AHCI #define BOOT_TARGET_DEVICES_SCSI (func) func(SCSI, scsi, 0)#else #define BOOT_TARGET_DEVICES_SCSI (func)#endif #ifdef CONFIG_USB_STORAGE #define BOOT_TARGET_DEVICES_USB (func) func(USB, usb, 0)#else #define BOOT_TARGET_DEVICES_USB (func)#endif #ifdef CONFIG_USB_FUNCTION_FASTBOOT #define BOOT_TARGET_DEVICES_FASTBOOT (func) func(FASTBOOT, fastboot, 0)#else #define BOOT_TARGET_DEVICES_FASTBOOT (func)#endif /* FEL boot support, auto-execute boot.scr if a script address was provided */ #define BOOTENV_DEV_FEL (devtypeu, devtypel, instance) \ "bootcmd_fel=" \ "if test -n ${fel_booted} && test -n ${fel_scriptaddr}; then " \ "echo '(FEL boot)'; " \ "source ${fel_scriptaddr}; " \ "fi\0"#define BOOTENV_DEV_NAME_FEL (devtypeu, devtypel, instance) \ "fel "#define BOOTENV_DEV_FASTBOOT (devtypeu, devtypel, instance) \ "bootcmd_fastboot=" \ "fastboot musb\0"#define BOOTENV_DEV_NAME_FASTBOOT (devtypeu, devtypel, instance) \ "fastboot "#define BOOT_TARGET_DEVICES (func) \ func(FEL, fel, na) \ BOOT_TARGET_DEVICES_MMC_EXTRA(func) \ BOOT_TARGET_DEVICES_MMC(func) \ BOOT_TARGET_DEVICES_SCSI(func) \ BOOT_TARGET_DEVICES_USB(func) \ BOOT_TARGET_DEVICES_FASTBOOT(func) \ func(PXE, pxe, na) \ func(DHCP, dhcp, na)#ifdef CONFIG_OLD_SUNXI_KERNEL_COMPAT #define BOOTCMD_SUNXI_COMPAT \ "bootcmd_sunxi_compat=" \ "setenv root /dev/mmcblk0p3 rootwait; " \ "if ext2load mmc 0 0x44000000 uEnv.txt; then " \ "echo Loaded environment from uEnv.txt; " \ "env import -t 0x44000000 ${filesize}; " \ "fi; " \ "setenv bootargs console=${console} root=${root} ${extraargs}; " \ "ext2load mmc 0 0x43000000 script.bin && " \ "ext2load mmc 0 0x48000000 uImage && " \ "bootm 0x48000000\0"#else #define BOOTCMD_SUNXI_COMPAT #endif #include <config_distro_bootcmd.h> #ifdef CONFIG_USB_KEYBOARD #define CONSOLE_STDIN_SETTINGS \ "preboot=usb start\0" \ "stdin=serial,usbkbd\0"#else #define CONSOLE_STDIN_SETTINGS \ "stdin=serial\0"#endif #ifdef CONFIG_VIDEO #define CONSOLE_STDOUT_SETTINGS \ "stdout=serial,vga\0" \ "stderr=serial,vga\0"#else #define CONSOLE_STDOUT_SETTINGS \ "stdout=serial\0" \ "stderr=serial\0"#endif #define CONSOLE_ENV_SETTINGS \ CONSOLE_STDIN_SETTINGS \ CONSOLE_STDOUT_SETTINGS/* The space below the paritions-entries is reserved by the EFI * partition table (i.e. 'first_usable_lba' points to the first * LBA beyond the table. We thus don't need to have any 'magic' * partitions for the bootloader or any other reserved areas. */ #define CONFIG_EFI_PARTITION_ENTRIES_OFF 1024000#define PARTS_DEFAULT \ "uuid_disk=${uuid_gpt_disk};" \ "name=resource,size=16M;" \ "name=boot,size=16M;" \ "name=system,size=500M,uuid=69dad710-2ce4-4e3c-b16c-21a1d49abed3;" \ "name=cache,size=256M;" \ "name=databk,size=128M;" \ "name=data,size=-,uuid=933ac7e1-2eb4-4f13-b844-0e14e2aef915;"#if (CONFIG_CONS_INDEX ==1 )#define CONSOLE_DEFAULT "console=ttyS0,115200\0"#elif (CONFIG_CONS_INDEX ==3 )#define CONSOLE_DEFAULT "console=ttyS2,115200\0"#else #error "CONFIG_CONS_INDEX to CONFIG_DEFAULT_CONSOLE_ENV missing."#endif #define CONFIG_EXTRA_ENV_SETTINGS \ CONSOLE_ENV_SETTINGS \ MEM_LAYOUT_ENV_SETTINGS \ DFU_ALT_INFO_RAM \ "partitions=" PARTS_DEFAULT "\0" \ "partitions_linux=" \ "uuid_disk=${uuid_gpt_disk};" \ "name=rootfs,size=-,uuid=69dad710-2ce4-4e3c-b16c-21a1d49abed3\0" \ "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ CONSOLE_DEFAULT \ BOOTCMD_SUNXI_COMPAT \ BOOTENV#else /* ifndef CONFIG_SPL_BUILD */ #define CONFIG_EXTRA_ENV_SETTINGS #endif #endif /* _SUNXI_COMMON_CONFIG_H */
Signature · 1 line
1.9.1
PATCH 1/2 sun8i: define CONFIG_PHY_GIGE for EMAC
Quoted 6 lines · Philipp Tomsich
From: Klaus Goger <[email protected]>
CONFIG_PHY_GIGEneeds to be defined formiiphy_speedto report correct speed.Signed-off-by Klaus Goger <[email protected]>Signed-off-by Philipp Tomsich <[email protected]>
PATCH 1/2 sun8i: define CONFIG_PHY_GIGE for EMAC
In reply to Philipp Tomsichinclude/configs/sunxi-common.h extern int soft_i2c_gpio_sda; · line 375
Quoted 3 lines · Philipp Tomsich
include/configs/sunxi-common.h +3
-0+#ifdef CONFIG_SUN8I_EMAC +#define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ +#endif
It would make more sense to move that option to Kconfig, and selecting it from SUN8I_EMAC.
Thanks!
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170221/1a51154d/attachment.sig>
PATCH 1/2 sun8i: define CONFIG_PHY_GIGE for EMAC
Quoted 8 lines · Maxime Ripard
include/configs/sunxi-common.h extern int soft_i2c_gpio_sda; · line 375
Quoted 3 lines · Philipp Tomsich
include/configs/sunxi-common.h +3
-0+#ifdef CONFIG_SUN8I_EMAC +#define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ +#endif It would make more sense to move that option to
Kconfig, and selecting it fromSUN8I_EMAC.
CONFIG_PHY_GIGE is not a Kconfig option yet and only enabled via board-specific config files.
Let me know if this changes anything, otherwise a change and reroll will be coming?
Phil.
PATCH 1/2 sun8i: define CONFIG_PHY_GIGE for EMAC
Quoted 10 lines · Dr. Philipp Tomsich
Quoted 8 lines · Maxime Ripard
include/configs/sunxi-common.h extern int soft_i2c_gpio_sda; · line 375
Quoted 3 lines · Philipp Tomsich
include/configs/sunxi-common.h +3
-0+#ifdef CONFIG_SUN8I_EMAC +#define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ +#endif It would make more sense to move that option to
Kconfig, and selecting it fromSUN8I_EMAC.
Quoted 2 lines
CONFIG_PHY_GIGEis not aKconfigoption yet and only enabled via board-specific config files.
Which is exactly what I was suggesting to do, sorry if it wasn't clear :)
We're still in the phase of getting options moved to kconfig, so this seems like the perfect occasion to do so.
Thanks!
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170222/c3d22a9d/attachment.sig>
PATCH 1/2 sun8i: define CONFIG_PHY_GIGE for EMAC
Quoted 14 lines · Maxime Ripard
Quoted 10 lines · Dr. Philipp Tomsich
Quoted 8 lines · Maxime Ripard
include/configs/sunxi-common.h extern int soft_i2c_gpio_sda; · line 375
Quoted 3 lines · Philipp Tomsich
include/configs/sunxi-common.h +3
-0+#ifdef CONFIG_SUN8I_EMAC +#define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ +#endif It would make more sense to move that option to
Kconfig, and selecting it fromSUN8I_EMAC.
Quoted 8 lines
Quoted 2 lines
CONFIG_PHY_GIGEis not aKconfigoption yet and only enabled via board-specific config files.Which is exactly what I was suggesting to do, sorry if it wasn't clear :)
We're still in the phase of getting options moved to kconfig, so this seems like the perfect occasion to do so.
Looks like this will be one of the many v2 patches for today. All I have to do now is to get my patch-format right ;-)
Cheers,
Philipp.
PATCH 2/2 sun8i: enable support for the Micrel KSZ9031 with SUN8I_EMAC
In reply to Philipp TomsichEnable support for the MICREL KSZ9031 GbE PHY in sunxi-common.h when
using the SUN8I_EMAC driver (e.g. on the A64).
X-AffectedPlatforms: A64-uQ7
--- include/configs/sunxi-common.h | 2 ++ 1 file changed, 2 insertions(+)
include/configs/sunxi-common.h +2 -0
@@ -285,327 +285,329 @@ extern int soft_i2c_gpio_sda;extern int soft_i2c_gpio_scl;#endif #define CONFIG_VIDEO_LCD_I2C_BUS 0/* The lcd panel soft i2c is bus 0 */ #define CONFIG_SYS_SPD_BUS_NUM 1/* And the axp209 i2c bus is bus 1 */ #else #define CONFIG_SYS_SPD_BUS_NUM 0/* The axp209 i2c bus is bus 0 */ #define CONFIG_VIDEO_LCD_I2C_BUS -1/* NA, but necessary to compile */ #endif /* PMU */ #if definedCONFIG_AXP152_POWER || definedCONFIG_AXP209_POWER || \ definedCONFIG_AXP221_POWER || definedCONFIG_AXP818_POWER || \ definedCONFIG_SY8106A_POWER #endif #ifndef CONFIG_CONS_INDEX #define CONFIG_CONS_INDEX 1/* UART0 */ #endif #ifdef CONFIG_REQUIRE_SERIAL_CONSOLE #if CONFIG_CONS_INDEX ==1 #ifdef CONFIG_MACH_SUN9I #define OF_STDOUT_PATH "/soc/serial at 07000000:115200"#else #define OF_STDOUT_PATH "/soc at 01c00000/serial at 01c28000:115200"#endif #elif CONFIG_CONS_INDEX ==2 && defined(CONFIG_MACH_SUN5I )#define OF_STDOUT_PATH "/soc at 01c00000/serial at 01c28400:115200"#elif CONFIG_CONS_INDEX ==3 && defined(CONFIG_MACH_SUN6I )#define OF_STDOUT_PATH "/soc at 01c00000/serial at 01c28800:115200"#elif CONFIG_CONS_INDEX ==3 && defined(CONFIG_MACH_SUN8I )#define OF_STDOUT_PATH "/soc at 01c00000/serial at 01c28800:115200"#elif CONFIG_CONS_INDEX ==5 && defined(CONFIG_MACH_SUN8I )#define OF_STDOUT_PATH "/soc at 01c00000/serial at 01f02800:115200"#else #error Unsupported console port nr. Please fix stdout-path in sunxi-common.h.#endif #endif /* ifdef CONFIG_REQUIRE_SERIAL_CONSOLE */ /* GPIO */ #define CONFIG_SUNXI_GPIO #ifdef CONFIG_VIDEO /* * The amount of RAM to keep free at the top of RAM when relocating u-boot, * to use as framebuffer. This must be a multiple of 4096. */ #define CONFIG_SUNXI_MAX_FB_SIZE (16 << 20)/* Do we want to initialize a simple FB? */ #define CONFIG_VIDEO_DT_SIMPLEFB /* Fallback to old sunxi_video if the driver model video driver is disabled */ #ifndef CONFIG_VIDEO_SUNXI_DM #define CONFIG_VIDEO_SUNXI #endif #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_BMP_LOGO #define CONFIG_CMD_BMP #define CONFIG_SPLASH_SCREEN_ALIGN #define CONFIG_VIDEO_STD_TIMINGS #define CONFIG_I2C_EDID #define VIDEO_LINE_LEN (pGD->plnSizeX)/* allow both serial and cfb console. */ /* stop x86 thinking in cfbconsole from trying to init a pc keyboard */ #endif /* CONFIG_VIDEO */ /* Ethernet support */ #ifdef CONFIG_SUNXI_EMAC #define CONFIG_PHY_ADDR 1#define CONFIG_MII /* MII PHY management */ #define CONFIG_PHYLIB #endif #ifdef CONFIG_SUNXI_GMAC #define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ /* Cherry-pick from A80: #define CONFIG_PHY_ADDR 1 */ #define CONFIG_MII /* MII PHY management */ #define CONFIG_PHY_REALTEK #define CONFIG_PHY_MICREL #define CONFIG_PHY_MICREL_KSZ9031 #endif #ifdef CONFIG_SUN8I_EMAC #define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ +#define CONFIG_PHY_MICREL +#define CONFIG_PHY_MICREL_KSZ9031 /* used on A64-uQ7 */ #endif #ifdef CONFIG_USB_EHCI_HCD #define CONFIG_USB_OHCI_NEW #define CONFIG_USB_OHCI_SUNXI #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 1#endif #ifdef CONFIG_USB_MUSB_SUNXI #define CONFIG_USB_MUSB_PIO_ONLY #endif #ifdef CONFIG_USB_MUSB_GADGET #define CONFIG_USB_FUNCTION_MASS_STORAGE #endif #ifdef CONFIG_USB_FUNCTION_FASTBOOT #define CONFIG_FASTBOOT_BUF_SIZE 0x8000000#define CONFIG_SYS_BOOTM_LEN 0x1000000#define CONFIG_SUNXI_FASTBOOT_GPIO "PM7"#ifdef CONFIG_SUNXI_FASTBOOT_GPIO # define CONFIG_BOARD_LATE_INIT #endif #ifdef CONFIG_MMC #define CONFIG_FASTBOOT_FLASH_MMC_DEV 1#define CONFIG_EFI_PARTITION_ENTRIES_OFF 1024000#define CONFIG_RANDOM_UUID #endif #endif #ifdef CONFIG_USB_FUNCTION_MASS_STORAGE #endif #ifdef CONFIG_USB_KEYBOARD #define CONFIG_PREBOOT #define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE #endif #if !definedCONFIG_ENV_IS_IN_MMC && \ !definedCONFIG_ENV_IS_IN_NAND && \ !definedCONFIG_ENV_IS_IN_FAT && \ !definedCONFIG_ENV_IS_IN_SPI_FLASH #define CONFIG_ENV_IS_NOWHERE #endif #define CONFIG_MISC_INIT_R #ifndef CONFIG_SPL_BUILD #include <config_distro_defaults.h> #ifdef CONFIG_ARM64 /* * Boards seem to come with at least 512MB of DRAM. * The kernel should go at 512K, which is the default text offset (that will * be adjusted at runtime if needed). * There is no compression for arm64 kernels (yet), so leave some space * for really big kernels, say 256MB for now. * Scripts, PXE and DTBs should go afterwards, leaving the rest for the initrd. * Align the initrd to a 2MB page. */ #define KERNEL_ADDR_R __stringify(SDRAM_OFFSET(0080000))#define FDT_ADDR_R __stringify(SDRAM_OFFSET(FA00000))#define SCRIPT_ADDR_R __stringify(SDRAM_OFFSET(FC00000))#define PXEFILE_ADDR_R __stringify(SDRAM_OFFSET(FD00000))#define RAMDISK_ADDR_R __stringify(SDRAM_OFFSET(FE00000))#else /* * 160M RAM (256M minimum minus 64MB heap + 32MB for u-boot, stack, fb, etc. * 32M uncompressed kernel, 16M compressed kernel, 1M fdt, * 1M script, 1M pxe and the ramdisk at the end. */ #define KERNEL_ADDR_R __stringify(SDRAM_OFFSET(2000000))#define FDT_ADDR_R __stringify(SDRAM_OFFSET(3000000))#define SCRIPT_ADDR_R __stringify(SDRAM_OFFSET(3100000))#define PXEFILE_ADDR_R __stringify(SDRAM_OFFSET(3200000))#define RAMDISK_ADDR_R __stringify(SDRAM_OFFSET(3300000))#endif #define MEM_LAYOUT_ENV_SETTINGS \ "bootm_size=0xa000000\0" \ "kernel_addr_r=" KERNEL_ADDR_R "\0" \ "fdt_addr_r=" FDT_ADDR_R "\0" \ "scriptaddr=" SCRIPT_ADDR_R "\0" \ "pxefile_addr_r=" PXEFILE_ADDR_R "\0" \ "ramdisk_addr_r=" RAMDISK_ADDR_R "\0"#define DFU_ALT_INFO_RAM \ "dfu_alt_info_ram=" \ "kernel ram " KERNEL_ADDR_R " 0x1000000;" \ "fdt ram " FDT_ADDR_R " 0x100000;" \ "ramdisk ram " RAMDISK_ADDR_R " 0x4000000\0"#ifdef CONFIG_MMC #define BOOT_TARGET_DEVICES_MMC (func) func(MMC, mmc, 0)#if CONFIG_MMC_SUNXI_SLOT_EXTRA !=-1 #define BOOT_TARGET_DEVICES_MMC_EXTRA (func) func(MMC, mmc, 1)#else #define BOOT_TARGET_DEVICES_MMC_EXTRA (func)#endif #else #define BOOT_TARGET_DEVICES_MMC (func)#define BOOT_TARGET_DEVICES_MMC_EXTRA (func)#endif #ifdef CONFIG_AHCI #define BOOT_TARGET_DEVICES_SCSI (func) func(SCSI, scsi, 0)#else #define BOOT_TARGET_DEVICES_SCSI (func)#endif #ifdef CONFIG_USB_STORAGE #define BOOT_TARGET_DEVICES_USB (func) func(USB, usb, 0)#else #define BOOT_TARGET_DEVICES_USB (func)#endif #ifdef CONFIG_USB_FUNCTION_FASTBOOT #define BOOT_TARGET_DEVICES_FASTBOOT (func) func(FASTBOOT, fastboot, 0)#else #define BOOT_TARGET_DEVICES_FASTBOOT (func)#endif /* FEL boot support, auto-execute boot.scr if a script address was provided */ #define BOOTENV_DEV_FEL (devtypeu, devtypel, instance) \ "bootcmd_fel=" \ "if test -n ${fel_booted} && test -n ${fel_scriptaddr}; then " \ "echo '(FEL boot)'; " \ "source ${fel_scriptaddr}; " \ "fi\0"#define BOOTENV_DEV_NAME_FEL (devtypeu, devtypel, instance) \ "fel "#define BOOTENV_DEV_FASTBOOT (devtypeu, devtypel, instance) \ "bootcmd_fastboot=" \ "fastboot musb\0"#define BOOTENV_DEV_NAME_FASTBOOT (devtypeu, devtypel, instance) \ "fastboot "#define BOOT_TARGET_DEVICES (func) \ func(FEL, fel, na) \ BOOT_TARGET_DEVICES_MMC_EXTRA(func) \ BOOT_TARGET_DEVICES_MMC(func) \ BOOT_TARGET_DEVICES_SCSI(func) \ BOOT_TARGET_DEVICES_USB(func) \ BOOT_TARGET_DEVICES_FASTBOOT(func) \ func(PXE, pxe, na) \ func(DHCP, dhcp, na)#ifdef CONFIG_OLD_SUNXI_KERNEL_COMPAT #define BOOTCMD_SUNXI_COMPAT \ "bootcmd_sunxi_compat=" \ "setenv root /dev/mmcblk0p3 rootwait; " \ "if ext2load mmc 0 0x44000000 uEnv.txt; then " \ "echo Loaded environment from uEnv.txt; " \ "env import -t 0x44000000 ${filesize}; " \ "fi; " \ "setenv bootargs console=${console} root=${root} ${extraargs}; " \ "ext2load mmc 0 0x43000000 script.bin && " \ "ext2load mmc 0 0x48000000 uImage && " \ "bootm 0x48000000\0"#else #define BOOTCMD_SUNXI_COMPAT #endif #include <config_distro_bootcmd.h> #ifdef CONFIG_USB_KEYBOARD #define CONSOLE_STDIN_SETTINGS \ "preboot=usb start\0" \ "stdin=serial,usbkbd\0"#else #define CONSOLE_STDIN_SETTINGS \ "stdin=serial\0"#endif #ifdef CONFIG_VIDEO #define CONSOLE_STDOUT_SETTINGS \ "stdout=serial,vga\0" \ "stderr=serial,vga\0"#else #define CONSOLE_STDOUT_SETTINGS \ "stdout=serial\0" \ "stderr=serial\0"#endif #define CONSOLE_ENV_SETTINGS \ CONSOLE_STDIN_SETTINGS \ CONSOLE_STDOUT_SETTINGS/* The space below the paritions-entries is reserved by the EFI * partition table (i.e. 'first_usable_lba' points to the first * LBA beyond the table. We thus don't need to have any 'magic' * partitions for the bootloader or any other reserved areas. */ #define CONFIG_EFI_PARTITION_ENTRIES_OFF 1024000#define PARTS_DEFAULT \ "uuid_disk=${uuid_gpt_disk};" \ "name=resource,size=16M;" \ "name=boot,size=16M;" \ "name=system,size=500M,uuid=69dad710-2ce4-4e3c-b16c-21a1d49abed3;" \ "name=cache,size=256M;" \ "name=databk,size=128M;" \ "name=data,size=-,uuid=933ac7e1-2eb4-4f13-b844-0e14e2aef915;"#if (CONFIG_CONS_INDEX ==1 )#define CONSOLE_DEFAULT "console=ttyS0,115200\0"#elif (CONFIG_CONS_INDEX ==3 )#define CONSOLE_DEFAULT "console=ttyS2,115200\0"#else #error "CONFIG_CONS_INDEX to CONFIG_DEFAULT_CONSOLE_ENV missing."#endif #define CONFIG_EXTRA_ENV_SETTINGS \ CONSOLE_ENV_SETTINGS \ MEM_LAYOUT_ENV_SETTINGS \ DFU_ALT_INFO_RAM \ "partitions=" PARTS_DEFAULT "\0" \ "partitions_linux=" \ "uuid_disk=${uuid_gpt_disk};" \ "name=rootfs,size=-,uuid=69dad710-2ce4-4e3c-b16c-21a1d49abed3\0" \ "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ CONSOLE_DEFAULT \ BOOTCMD_SUNXI_COMPAT \ BOOTENV#else /* ifndef CONFIG_SPL_BUILD */ #define CONFIG_EXTRA_ENV_SETTINGS #endif #endif /* _SUNXI_COMMON_CONFIG_H */
Signature · 1 line
1.9.1
PATCH 2/2 sun8i: enable support for the Micrel KSZ9031 with SUN8I_EMAC
include/configs/sunxi-common.h extern int soft_i2c_gpio_sda; · line 377
Quoted 5 lines · Philipp Tomsich
#ifdef
CONFIG_SUN8I_EMAC
#defineCONFIG_PHY_GIGE/* GMAC can use gigabit PHY */include/configs/sunxi-common.h +2
-0+#define CONFIG_PHY_MICREL +#define CONFIG_PHY_MICREL_KSZ9031 /* used on A64-uQ7 */ #endif
Same thing here, and that way you could enable it only on the board defconfig.
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170221/66d3c559/attachment.sig>
PATCH 2/2 sun8i: enable support for the Micrel KSZ9031 with SUN8I_EMAC
Maxime,
Quoted 11 lines · Maxime Ripard
Quoted 5 lines · Philipp Tomsich
#ifdef
CONFIG_SUN8I_EMAC
#defineCONFIG_PHY_GIGE/* GMAC can use gigabit PHY */include/configs/sunxi-common.h +2
-0+#define CONFIG_PHY_MICREL +#define CONFIG_PHY_MICREL_KSZ9031 /* used on A64-uQ7 */ #endif
Same thing here, and that way you could enable it only on the board defconfig.
CONFIG_PHY_MICREL_KSZ9031 is not exported via Kconfig today. I?m happy to see this moved to Kconfig & defconfig, but just checking if that info changes anything?
Regards,
Phil.
PATCH 2/2 sun8i: enable support for the Micrel KSZ9031 with SUN8I_EMAC
Maxime,
Quoted 15 lines · Dr. Philipp Tomsich
Maxime,
Quoted 11 lines · Maxime Ripard
Quoted 5 lines · Philipp Tomsich
#ifdef
CONFIG_SUN8I_EMAC
#defineCONFIG_PHY_GIGE/* GMAC can use gigabit PHY */include/configs/sunxi-common.h +2
-0+#define CONFIG_PHY_MICREL +#define CONFIG_PHY_MICREL_KSZ9031 /* used on A64-uQ7 */ #endif
Same thing here, and that way you could enable it only on the board defconfig.
I?d really like to keep this for all SUN8I_EMAC configurations, as we need the PHY support to initialise the pad timing parameters from the DTS. If these are not initialised, then RGMII (i.e. Gigabit) will not work.
As we are moving towards a ?universal? U-Boot binary for sun50i and try to put all board specific info into the DTS, I?d like to keep this in sunxi-common.h to ensure that nobody rebuild without it and then has issues on our boards.
Regards,
Philipp.
PATCH 2/2 sun8i: enable support for the Micrel KSZ9031 with SUN8I_EMAC
Quoted 18 lines · Dr. Philipp Tomsich
Maxime,
Quoted 15 lines · Dr. Philipp Tomsich
Maxime,
Quoted 11 lines · Maxime Ripard
Quoted 5 lines · Philipp Tomsich
#ifdef
CONFIG_SUN8I_EMAC
#defineCONFIG_PHY_GIGE/* GMAC can use gigabit PHY */include/configs/sunxi-common.h +2
-0+#define CONFIG_PHY_MICREL +#define CONFIG_PHY_MICREL_KSZ9031 /* used on A64-uQ7 */ #endif
Same thing here, and that way you could enable it only on the board defconfig.
Quoted 3 lines
I?d really like to keep this for all
SUN8I_EMACconfigurations, as we need the PHY support to initialise the pad timing parameters from the DTS. If these are not initialised, then RGMII (i.e. Gigabit) will not work.
I'm not really discussing whether it is needed or not.
Quoted 4 lines
As we are moving towards a ?universal? U-Boot binary for sun50i and try to put all board specific info into the DTS, I?d like to keep this in
sunxi-common.hto ensure that nobody rebuild without it and then has issues on our boards.
I'm not buying the whole universal U-Boot binary thing, but that's really not related to the discussion. sunxi-common.h should be reduced, not expanded to cover new stuff, in favor of Kconfig.
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170222/781e9afc/attachment.sig>
PATCH 2/2 sun8i: enable support for the Micrel KSZ9031 with SUN8I_EMAC
Maxime,
Quoted 21 lines · Maxime Ripard
Quoted 18 lines · Dr. Philipp Tomsich
Maxime,
Quoted 15 lines · Dr. Philipp Tomsich
Maxime,
Quoted 11 lines · Maxime Ripard
Quoted 5 lines · Philipp Tomsich
#ifdef
CONFIG_SUN8I_EMAC
#defineCONFIG_PHY_GIGE/* GMAC can use gigabit PHY */include/configs/sunxi-common.h +2
-0+#define CONFIG_PHY_MICREL +#define CONFIG_PHY_MICREL_KSZ9031 /* used on A64-uQ7 */ #endif
Same thing here, and that way you could enable it only on the board defconfig.
Quoted 5 lines
Quoted 3 lines
I?d really like to keep this for all
SUN8I_EMACconfigurations, as we need the PHY support to initialise the pad timing parameters from the DTS. If these are not initialised, then RGMII (i.e. Gigabit) will not work.I'm not really discussing whether it is needed or not.
The discussion is moot anyway, as I had this change already committed for v2 this afternoon.
Quoted 8 lines
Quoted 4 lines
As we are moving towards a ?universal? U-Boot binary for sun50i and try to put all board specific info into the DTS, I?d like to keep this in
sunxi-common.hto ensure that nobody rebuild without it and then has issues on our boards.I'm not buying the whole universal U-Boot binary thing, but that's really not related to the discussion.
sunxi-common.hshould be reduced, not expanded to cover new stuff, in favor ofKconfig.
I?ve just put v2 onto the list and only touch the SUN8I_EMAC in v2. The same should be done for SUNXI_GMAC and we?ll cycle back to it, once the DM stuff is done (so we can update our A31 support to it and release any pending changes left over from the A31-uQ7).
Regards,
Philipp.