Re: [U-Boot] [PATCH 0/2] [RFC] DEBUG: relocate to fixed address
Dear Tetsuyuki Kobayashi, In message 1353476660-18018-1-git-send-email-k...@kmckk.co.jp you wrote: U-Boot from NOR flash relocates itself to RAM erea. The relocation address is calaculated at runtime to get maxium contiguous space to load kernel. So it may vary after code changed. In the early debug phase it would be easier to handle if the relocation address does not change per build. No, it is not. You still need to determine where it gets relocated to, and iot makes no difference for debugging wehter you enter one number or another one. Any debugger out there today allows you to automatemost such operations by scripts or functions or macros you can define to help you doing that. My idea is define fixed address as CONFIG_DEBUG_RELOC_FIX_ADDR in config file and relocate to the address. Then you don't need to execute 'bdinfo' command to get actual relocated address. It is done by the first patch. I'm not willing to accept such change. It appears to ad a (minimal) easement at first glance, but at the same time it bears potential to break a large number of other things, and not unlikely in areas which are why you need to run a debugger in the first place. This makes no sense. The second patch is for u-boot_r, which is linked for fixed relocation address. When you want to symbolic debug after relocation, flash 'u-boot.bin' and load symbol from 'u-boot_r' to debugger. (CF. When you want to symblic debug before relocation, load symbol from 'u-boot' to debugger.) Why would that be needed? The standard ELF file has all debug information you ever may need. Just to save the load symbol table command? Again, this is not worth the effort on one side, and likely to break things in other places. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de The net result is a system that is not only binary compatible with 4.3 BSD, but is even bug for bug compatible in almost all features. - Avadit Tevanian, Jr., Architecture-Independent Virtual Memory Management for Parallel and Distributed Environments: The Mach Approach ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] DEBUG: fix relocation address
Dear Tetsuyuki Kobayashi, In message 1353476660-18018-2-git-send-email-k...@kmckk.co.jp you wrote: U-Boot from NOR flash relocates itself to RAM erea. The relocation address is calaculated at runtime to get maxium contiguous space to load kernel. So it may vary after code changed. In the early debug phase it would be easier to handle if the relocation address does not change. This patch sets relocation address to fixed address specified by CONFIG_DEBUG_RELOC_FIX_ADDR. If there is no enough space after CONFIG_DEBUG_RELOC_FIX_ADDR, it is ignored. patch to kzm9g.h is a example. CONFIG_DEBUG_RELOC_FIX_ADDR should be defined at each config file. Signed-off-by: Tetsuyuki Kobayashi k...@kmckk.co.jp --- arch/arm/lib/board.c|9 - include/configs/kzm9g.h |4 2 files changed, 12 insertions(+), 1 deletion(-) NAK for this patch for the general reasons outlined oin my summary reply to the cover letter. In addition: - If this is supposed to be a RFC patch series, then please add the RFC part to ALL patches, not only to the cover letter. - Any changes to basic infrastucture like this have to be done in a general, architecture-independent way. Doing this for ARM only is not acceptable. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Confound these ancestors They've stolen our best ideas! - Ben Jonson ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/8] arm: Add boottime support for the ARM architecture
Hi Wolfgang, In message 1353422034-28107-6-git-send-email-lee.jo...@linaro.org you wrote: This patch adds support for passing boot time information to the Linus kernel using ATAGS when booting on ARM based devices. I implicitly mentioned this before, here it comes clear again: Ah, this has been tried before? Sorry, I didn't know that. I dislike the idea of adding such infrastructure in an archittecture dependent way, knowing from day one that we cannot use this as is for other architectures, and that the mechanism being used is even going to go away for this architecutre, too. Please come up with a solution that works for all architectures instead. So I guess Device Tree it is then. Kind regards, Lee -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 00/46] Enhance spear support
Dear Vipin, In message 50a0d0eb.4080...@st.com you wrote: The ssh key is as below THnaks a lot. The repository should be ready for your use now. Sorry it took so long. Please feel free to contact me directly if there should be any problems. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de I will also, for an appropriate fee, certify that your keyboard is object-oriented, and that the bits on your hard disk are template- compatible.- Jeffrey S. Haemer in 411akr$3...@cygnus.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/8] arm: Add boottime support for the ARM architecture
Dear Lee Jones, In message 20121121091717.gg28...@gmail.com you wrote: Hi Wolfgang, In message 1353422034-28107-6-git-send-email-lee.jo...@linaro.org you wrote: This patch adds support for passing boot time information to the Linus kernel using ATAGS when booting on ARM based devices. I implicitly mentioned this before, here it comes clear again: Ah, this has been tried before? Sorry, I didn't know that. I expolained it in my reply to your cover letter, i.e. in the message immediately preceeding the one you replied to here. I dislike the idea of adding such infrastructure in an archittecture dependent way, knowing from day one that we cannot use this as is for other architectures, and that the mechanism being used is even going to go away for this architecutre, too. Please come up with a solution that works for all architectures instead. So I guess Device Tree it is then. No. The device tree is for passing hardware information to U-Boot and the kernel. It is NOT intended for carrying things like debug or timing logs. It is not a good idea to misuse such services for things they were not made for nor where they fit. Please use a standard facility, and one designed for such purposes like the Linux log buffer for this purpose. As explained, this has the added benefit that you don't need to change any Linux code. And you can build on the (also existing) show_boot_progress() support in U-Boot, so the extesions should actually be really small and pretty clear. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de backups: always in season, never out of style. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/8] boottime: Apply some key boottime tags into common code
On Tue, 20 Nov 2012, Wolfgang Denk wrote: Dear Lee Jones, In message 1353422034-28107-5-git-send-email-lee.jo...@linaro.org you wrote: Here we add boottime tags to the start of the main loop and just before the opportunity to break into the u-boot shell. This will provide a more verbose bootgraph when viewed within debugfs. Assuming we would take this route - then why do we need to add new boottime_tag() entries - is there anything wrong with the existing show_boot_progress() code? Did you consider using this instead? If so, why did you not use it? No, I didn't know it existed. Basically I've taken responsibility to upstream someone else's driver. It's more of a kernel thing, but it requires boottime information from u-boot too, as the intention is to cover full system booting, rather than the kernel-only tracing mechanisms which already exist. I've just taken a look at show_boot_process() though. It doesn't appear to be suitable for what we require. Each tag needs to be individually identifiable, and I'm not sure how you would achieve this if we were to call back into a single function which would do the tagging. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/8] boottime: Add core boottime measurement support
Boottime is a tool which can be used for full system booting time measurement. Bootloader boot time is passed to the kernel component though ATAGS. The kernel-side driver then uses this information to provide full system boot time diagnostics though debugfs. Aren't we converting more and more systems to use the device treee to pass information to the kenrel, with the result that ATAGS are kind of becoming extinct? Yes, I intend to extend this functionality into Device Tree. That way it will be architecture and OS independent. And forcing something upon a mechanism that was designed for a completely different purpose, where you see right from the first glance that it does not math easily? Not entirely sure what you mean here. This mechanism works perfectly with ATAGs. This makes no sense to me. Why don't you use standard mechanisms, like a shared log buffer, and simply create time-stamped entries into the kernel boot log? The advantages should be obvious: we will need no extra kernel modification, we do not depend on ATAGS, and we are automatically architecture-independent. Wouldn't this clog up the kernel's log buffer? I'm sure no user wants to see reams of otherwise useless logging scrawled throughout their bootlog. We'd also have a write a text parser to obtain the information for processing. It would be easier to either pass in a struct, as we do with the ATAG mechanism, or though Device Tree as previously discussed. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/8] u8500: Correct unnecessary mathematical roll-over
If we attempt to take a 32bit timer value and multiply it by a significant number, the core will not be able to handle it. This gives the illusion that the timer is rolling over, when in fact this is not the case. If we ensure the division in this instance is carried out before the multiplication, the issue vanishes. Are you sure this is a good idea? Not now I'm not. :) --- a/arch/arm/cpu/armv7/u8500/timer.c +++ b/arch/arm/cpu/armv7/u8500/timer.c @@ -70,7 +70,7 @@ struct u8500_mtu { * The MTU is clocked at 133 MHz by default. (V1 and later) */ #define TIMER_CLOCK(133 * 1000 * 1000 / 16) -#define COUNT_TO_USEC(x) ((x) * 16 / 133) +#define COUNT_TO_USEC(x) ((x) / 133 * 16) Before the change, the result is useful for all values of x in the interval from 0 through UINT_MAX/16 = 268435455 = 268 seconds, i. e. for all values that make sense to be measured in microseconds. We're actually discussing this elsewhere. I don't have permission to paste the other side of the conversation, but I can show you my calculations: The original implementation is fine until we reach 32.28 seconds, which as you predicted is 0x1000_: 0x1000 * PRESCALER) / (CLOCK_SPEED_133_MHZ) (268435456 * 16 ) / (133 * 1000 * 1000) == 32.28 seconds If we spend 30 seconds at the u-boot commandline, which is not unreasonable by any stretch, then the kernel assumes responsibility for the remaining of the time spent at the prompt, which is obviously not acceptable for this usecase. I doubt x will never be 133, as that will be 16 micro-seconds post timer-start or role-over. Do we really need that degree of resolution? Am assuming by your response that I'm wrong somewhere, and the resolution loss will be 16us? After the change, the result is changed to the worse for all low values of X, especially for the ranges from 16 through 132. You lose accuracy here, and win nothing. This makes no sense to me. If you need a bigger number range, then use proper arithmetics. It';s available, just use it. Would you be able to lend a hand here, as I'm no mathematician? What are the correct arithmetics? Kind regards, Lee -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/8] Adding boottime support
In this patch-set we're attempting to add boottime measurement support to u-boot. A patch-set has already hit the kernel MLs which intends to solve the other half of the puzzle. This new tool allows an engineer to apply tags into key areas around the bootloader, which are then passed to the Linux kernel for processing and statistics analysis of full (bootloader + kernel) device booting. tags into key areas around the boot loader? Why do you reinvent the wheel, squarely this time? Why don't you simply use a shared log buffer? Please see my previous email. Kind regards, Lee -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/8] arm: Add boottime support for the ARM architecture
This patch adds support for passing boot time information to the Linus kernel using ATAGS when booting on ARM based devices. I implicitly mentioned this before, here it comes clear again: Ah, this has been tried before? Sorry, I didn't know that. I expolained it in my reply to your cover letter, i.e. in the message immediately preceeding the one you replied to here. So you're telling me off for sending a patch which doesn't agree with something you've said, despite you saying it _after_ I sent the patch? Sounds sensible. :) I dislike the idea of adding such infrastructure in an archittecture dependent way, knowing from day one that we cannot use this as is for other architectures, and that the mechanism being used is even going to go away for this architecutre, too. Please come up with a solution that works for all architectures instead. So I guess Device Tree it is then. No. The device tree is for passing hardware information to U-Boot and the kernel. It is NOT intended for carrying things like debug or timing logs. It is not a good idea to misuse such services for things they were not made for nor where they fit. Okay, got it. Please use a standard facility, and one designed for such purposes like the Linux log buffer for this purpose. As explained, this has the added benefit that you don't need to change any Linux code. And you can build on the (also existing) show_boot_progress() support in U-Boot, so the extesions should actually be really small and pretty clear. When you say log buffer, do you mean __log_buf? Doesn't this contain logs used for dmesg; thus won't all this crud end up in a user's dmesg kernel log? Unless there is another log which is used only for the kernel. Also, wouldn't I then have to write a text parser to process this information? Sounds horrendous. Hopefully, I have missed something and it's actually easier than what I've mentioned. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 6/7] gpt: Support for new gpt command
Dear Stephen, -Original Message- From: Stephen Warren [mailto:swar...@wwwdotorg.org] Sent: Monday, November 19, 2012 10:35 PM To: Piotr Wilczek Cc: u-boot@lists.denx.de; Minkyu Kang; Kyungmin Park; Chang Hyun Park; Lukasz Majewski; Stephen Warren; Tom Rini; Rob Herring Subject: Re: [PATCH v4 6/7] gpt: Support for new gpt command On 11/09/2012 03:48 AM, Piotr Wilczek wrote: New command - gpt is supported. It restores the GPT partition table. It looks into the partitions environment variable for partitions definition. It can be enabled at target configuration file with CONFIG_CMD_GPT. Simple UUID generator has been implemented. It uses the the gd-start_addr_sp for entrophy pool. Moreover the pool address is used as crc32 seed. diff --git a/common/cmd_gpt.c b/common/cmd_gpt.c +U_BOOT_CMD(gpt, CONFIG_SYS_MAXARGS, 1, do_gpt, + GUID Partition Table, + interface dev partions list\n +partions list is in format: name=..,size=..,uuid=..;...\n +and can be passed as env or string ex.:\n + gpt mmc 0 partitions\n I don't think that form makes sense. The user should just pass ${partitions} instead. The command can't know for certain whether the user actually intended to pass the text partitions and made a mistake, or whether they passed an environment variable. If you really want to be able to pass an environment variable name, an explicit command-line option such as: gpt mmc 0 name=... # definition on cmd-line gpt mmc 0 --from-environment partitions # definition in environment seems best. The intention was that the command automatically figures out whether user passed environmental variable or directly partitions as text. Then the command splits this string, checks if it is a valid partitions list and if so the table is written to mmc. That is how the code is supposed to work. The question here is, if it should work like that. If it is desired that user explicitly states that the partitions list is passed from environmental, then I should change the code. + gpt mmc 0 \name=..,size=..;name=..,size=..;...\\n + gpt mmc 0 \name=${part1_name},size=..;name=..,size=..;...\\n +- GUID partition table restoration\n +Restore GPT information on a device connected\n +to interface\n Is writing a GPT to a device the only thing the gpt command will ever do. It seems best to require the user to write gpt write mmc 0 ... from the very start, so that if e.g. gpt fix-crcs or gpt interactive-edit or gpt delete-partition 5 are implemented in the future, existing scripts won't have to change to add the write parameter. I agree that the parameter write should be implemented. +/** + * extract_env(): Convert string from '{env_name}' to 'env_name' s//$/ It's doing more than that; it locates that syntax within an arbitrary string and ignores anything before ${ or after }. Is that intentional? Yes, it was. The u-boot's shell expands to one only, so it allow to pass any partition parameter as env when the partitions list itself is passed as env. +static int extract_env(char *p) + p1 = strstr(p, ${); + p2 = strstr(p, }); + + if (p1 p2) { + *p2 = '\0'; + memmove(p, p+2, p2-p1-1); s/-1/-2/ I think, since the length of ${ is 2 not 1. p2-p1-1 gives length of the env name + trailing zero. p2-p1-2 would give only the env's length and the trailing zero wouldn't be moved. Spaces around operators? s/p+2/p + 2/ for example. Yes +/** + * extract_val(): Extract value from a key=value pair + * + * @param p - pointer to string Pointer to pointer to string, given its type? Right + * @param tab - table to store extracted value + * @param i - actual tab element to work on Table? Why not just pass in char **tab and get rid of i. +static int extract_val(char **p, char *tab[], int i, char *key) { + char *t, *e, *tok = *p; + char *k; Those variable names are not exactly descriptive. I change the names. + t = strsep(tok, ,); + k = t; + strsep(t, =); + + if (key strcmp(k, key)) + return -2; + + if (extract_env(t) == 0) { Hmm. That only allows key=${value}. What about key=text${envothertext or key=${env1}foo${env2}? Isn't there some generic code that can already expand environment variables within strings so we don't have to re-invent it here? I check it. + tab[i] = calloc(strlen(t) + 1, 1); + if (tab[i] == NULL) { + printf(%s: calloc failed!\n, __func__); + return -1; + } + strcpy(tab[i], t); Isn't strdup() available? Yes, it is. +static int set_gpt_info(block_dev_desc_t *dev_desc, char *str_part, + disk_partition_t *partitions[], const int parts_count) { + char *ps[parts_count]; Can we call this sizes? Can't we call strtoul() and store int sizes[] rather than storing the strings first and then converting to
Re: [U-Boot] [PATCH v4 5/7] gpt: Support for GPT (GUID Partition Table) restoration
Dear Stephen, -Original Message- From: Stephen Warren [mailto:swar...@wwwdotorg.org] Sent: Monday, November 19, 2012 9:17 PM To: Piotr Wilczek Cc: u-boot@lists.denx.de; Minkyu Kang; Kyungmin Park; Chang Hyun Park; Lukasz Majewski; Stephen Warren; Tom Rini; Rob Herring Subject: Re: [PATCH v4 5/7] gpt: Support for GPT (GUID Partition Table) restoration On 11/09/2012 03:48 AM, Piotr Wilczek wrote: The restoration of GPT table (both primary and secondary) is now possible. Simple GUID generation is supported. diff --git a/include/part.h b/include/part.h +int set_gpt_table(block_dev_desc_t *dev_desc, + gpt_header *gpt_h, gpt_entry *gpt_e); void +gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e, + disk_partition_t *partitions[], int parts); void +gpt_fill_header(block_dev_desc_t *dev_desc, gpt_header *gpt_h); +void gpt_fill(block_dev_desc_t *dev_desc, disk_partition_t *partitions[], + const int parts_count); Why const? The const is not necessary. Some documentation for these functions (particularly high-level information such as which order you'd expect to call them and why/what for) would be useful in the header rather than the .c file; the header is where people would go to find out what functions they can call, so making them also go look in the .c file would be a bit annoying. That documentation should be moved to header files. diff --git a/disk/part_efi.c b/disk/part_efi.c +static int set_protective_mbr(block_dev_desc_t *dev_desc); + +static void guid_dump(u8 *guid, int i); + +static void guid_gen(const u32 *pool, u8 *guid); + +static int convert_uuid(char *uuid, u8 *dst); + +static void set_part_name(efi_char16_t *part_name, char *name); There probably should be a CONFIG_ option required to enable this new feature, so people who don't want it don't suffer code bloat. Do you really need the blank lines between prototypes? I suspect you can re-order the functions so that none of the prototypes are needed anyway. I try to reorder the functions and eliminate prototypes. +/** + * set_gpt_table() - Restore the GUID Partition Table write would probably be better than set. Yes, write is better. + * + * @param dev_desc - block device descriptor + * @param parts - number of partitions + * @param size - pointer to array with each partition size + * @param name - pointer to array with each partition name Those last 3 lines don't match the prototype. I should fix it. + * @return - zero on success, otherwise error */ int +set_gpt_table(block_dev_desc_t *dev_desc, + gpt_header *gpt_h, gpt_entry *gpt_e) Presumably the code assumes that gpt_e always has 128(?) entries. Instead of taking a pointer, should the function take an array: gpt_entry gpt_e[GPT_ENTRY_NUMBERS] to enforce this? +{ + const int pte_blk_num = (GPT_ENTRY_NUMBERS * sizeof(gpt_entry)) / + dev_desc-blksz; Related, this hard-codes the number of ptes as GPT_ENTRY_NUMBERS, whereas ... + u32 calc_crc32; + u64 val; + + debug(max lba: %x\n, (u32) dev_desc-lba); + /* Setup the Protective MBR */ + if (set_protective_mbr(dev_desc) 0) + goto err; + + /* Generate CRC for the Primary GPT Header */ + calc_crc32 = efi_crc32((const unsigned char *)gpt_e, + le32_to_cpu(gpt_h-num_partition_entries) * + le32_to_cpu(gpt_h-sizeof_partition_entry)); ... here, gpt_h-num_partition_entries is used instead. Should both places use the same size (entry count) definition? + if (dev_desc-block_write(dev_desc-dev, 2, pte_blk_num, gpt_e) + != pte_blk_num) + goto err; Here, we assume GPT_ENTRY_NUMBERS entries in gpt_e. If the array isn't that big, the block_write() above will read past the end of it. + puts(GPT successfully written to block device!\n); Isn't that something that a command should be doing, not a utility function? I'd rather have this function not print anything, except perhaps on errors, just like typical Unix command-line applications. +void gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e, + disk_partition_t *partitions[], int parts) Why is partitions an array of pointers rather than an array of partitions? The partitions is a variable size array stack allocated and each element points to heap allocated disk_partition. I think of how to reorganize this part of the code. +{ + u32 offset = (u32) le32_to_cpu(gpt_h-first_usable_lba); I don't think there should be a space after the cast. The same comment probably applies elsewhere. + for (i = 0; i parts; i++) { + /* partition starting lba */ + start = partitions[i]-start; + if (start (offset = start)) + gpt_e[i].starting_lba = cpu_to_le32(start); + else +
[U-Boot] [PATCH v2 00/67] net: net subsystem ops cleanup
This patchi series is a first stage of preparation of the net subsystem for the driver model. The idea of this patchset is: 1) Remove ops .init, .send, .recv and .halt from the eth_device struct. Add a sparate structure eth_ops which is ready for inclusion to DM core. 2) Replace dynamic init of ops function pointers by static struct. 3) Do minor style cleanup. There are binary size changes. Example: before the series applied: Configuring for colibri_pxa270 board... textdata bss dec hex filename 2479104412 272348 524670 8017e ./u-boot and after: Configuring for colibri_pxa270 board... textdata bss dec hex filename 2478784432 272368 524678 80186 ./u-boot Changes in v2: - Fix hidden drivers in arch/* - Prove bisectability: MAKEALL arm (1/67 applied): Boards compiled: 274 MAKEALL arm (49/67 applied): Boards compiled: 274 MAKEALL arm (67/67 applied): Boards compiled: 274 MAKEALL mips (1/67 applied): Boards compiled: 21 MAKEALL mips (49/67 applied): Boards compiled: 21 MAKEALL mips (67/67 applied): Boards compiled: 21 MAKEALL powepc (1/67 applied): Boards compiled: 623 MAKEALL powepc (49/67 applied): Boards compiled: 623 MAKEALL powepc (67/67 applied): Boards compiled: 623 Tomas Hlavacek (67): net: dm: Pull out ops from struct eth_device net: 4xx_enet: Pull out init of struct eth_ops net: altera_tse: Pull out init of struct eth_ops net: dm9000x: Pull out init of struct eth_ops net: armada100_fec: Pull out init of struct eth_ops net: at91_emac: Pull out init of struct eth_ops net: ax88180: Pull out init of struct eth_ops net: bfin_mac: Pull out init of struct eth_ops net: calxedaxgmac: Pull out init of struct eth_ops net: cs8900: Pull out init of struct eth_ops net: davinci_emac: Pull out init of struct eth_ops net: dc2114x: Pull out init of struct eth_ops net: designware: Pull out init of struct eth_ops net: dnet: Pull out init of struct eth_ops net: e1000: Pull out init of struct eth_ops net: eepro100: Pull out init of struct eth_ops net: enc28j60: Pull out init of struct eth_ops net: ep93xx_eth: Pull out init of struct eth_ops net: ethoc: Pull out init of struct eth_ops net: fec_mxc: Pull out init of struct eth_ops net: ftgmac100: Pull out init of struct eth_ops net: greth.c: Pull out init of struct eth_ops net: fsl_mcdmafec: Pull out init of struct eth_ops net: inca-ip_sw: Pull out init of struct eth_ops net: ks8695eth: Pull out init of struct eth_ops net: lan91c96: Pull out init of struct eth_ops net: macb: Pull out init of struct eth_ops net: mcffec: Pull out init of struct eth_ops net: mpc5xxx_fec: Pull out init of struct eth_ops net: mvgbe: Pull out init of struct eth_ops net: mpc512x_fec: Pull out init of struct eth_ops net: natsemi: Pull out init of struct eth_ops net: ne2000: Pull out init of struct eth_ops net: npe: Pull out init of struct eth_ops net: ns8382x: Pull out init of struct eth_ops net: pcnet: Pull out init of struct eth_ops net: plb2800_eth: Pull out init of struct eth_ops net: rtl8139: Pull out init of struct eth_ops net: rtl8169: Pull out init of struct eth_ops net: smc9: Pull out init of struct eth_ops net: smc911x: Pull out init of struct eth_ops net: tsec: Pull out init of struct eth_ops net: tsi108_eth: Pull out init of struct eth_ops net: uli526x: Pull out init of struct eth_ops net: xilinx_axi_emac: Pull out init of struct eth_ops net: xilinx_emaclite: Pull out init of struct eth_ops net: zynq_gem: Pull out init of struct eth_ops net: xilinx_ll_temac: Pull out init of struct eth_ops net: sh_eth: Pull out init of struct eth_ops net: au1x00_eth: Pull out init of struct eth_ops net: mpc8220_fec: Pull out init of struct eth_ops net: mpc8260_fec: Pull out init of struct eth_ops net: mpc8260_scc: Pull out init of struct eth_ops net: mpc85xx_fec: Pull out init of struct eth_ops net: mpc8xx_scc: Pull out init of struct eth_ops net: db64360/mv_eth: Pull out init of struct eth_ops net: mpc8xx_fec: Pull out init of struct eth_ops net: db64460/mv_eth: Pull out init of struct eth_ops net: cpci750/mv_eth: Pull out init of struct eth_ops net: evb64260: Pull out init of struct eth_ops net: p3mx/mv_eth: Pull out init of struct eth_ops net: cpsw: Pull out init of struct eth_ops net: fm_eth: Pull out init of struct eth_ops net: ftmac100: Pull out init of struct eth_ops net: qe: uec: Pull out init of struct eth_ops net: usb: asix: Pull out init of struct eth_ops net: usb: smsc95xx: Pull out init of struct eth_ops arch/mips/cpu/mips32/au1x00/au1x00_eth.c | 14 +- arch/powerpc/cpu/mpc8220/fec.c | 11 +++ arch/powerpc/cpu/mpc8260/ether_fcc.c | 14 +- arch/powerpc/cpu/mpc8260/ether_scc.c | 12 arch/powerpc/cpu/mpc85xx/ether_fcc.c | 14 +- arch/powerpc/cpu/mpc8xx/fec.c| 12
[U-Boot] [PATCH v2 05/67] net: armada100_fec: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/armada100_fec.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/armada100_fec.c b/drivers/net/armada100_fec.c index f256381..d826e11 100644 --- a/drivers/net/armada100_fec.c +++ b/drivers/net/armada100_fec.c @@ -678,6 +678,13 @@ static int armdfec_recv(struct eth_device *dev) return 0; } +static struct eth_ops armada100_fec_ops = { + .init = armdfec_init, + .halt = armdfec_halt, + .send = armdfec_send, + .recv = armdfec_recv +}; + int armada100_fec_register(unsigned long base_addr) { struct armdfec_device *darmdfec; @@ -718,10 +725,7 @@ int armada100_fec_register(unsigned long base_addr) /* must be less than sizeof(dev-name) */ strcpy(dev-name, armd-fec0); - dev-eo-init = armdfec_init; - dev-eo-halt = armdfec_halt; - dev-eo-send = armdfec_send; - dev-eo-recv = armdfec_recv; + dev-eo = armada100_fec_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 04/67] net: dm9000x: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/dm9000x.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c index bd96948..f6b226c 100644 --- a/drivers/net/dm9000x.c +++ b/drivers/net/dm9000x.c @@ -623,6 +623,13 @@ dm9000_phy_write(int reg, u16 value) DM9000_DBG(dm9000_phy_write(reg:0x%x, value:0x%x)\n, reg, value); } +static struct eth_ops dm9000_ops = { + .init = dm9000_init, + .send = dm9000_send, + .recv = dm9000_rx, + .halt = dm9000_halt +}; + int dm9000_initialize(bd_t *bis) { struct eth_device *dev = (dm9000_info.netdev); @@ -630,10 +637,7 @@ int dm9000_initialize(bd_t *bis) /* Load MAC address from EEPROM */ dm9000_get_enetaddr(dev); - dev-eo-init = dm9000_init; - dev-eo-halt = dm9000_halt; - dev-eo-send = dm9000_send; - dev-eo-recv = dm9000_rx; + dev-eo = dm9000_ops; sprintf(dev-name, dm9000); eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 03/67] net: altera_tse: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/altera_tse.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c index ee1a1f6..89cd23e 100644 --- a/drivers/net/altera_tse.c +++ b/drivers/net/altera_tse.c @@ -890,6 +890,14 @@ static int tse_eth_init(struct eth_device *dev, bd_t * bd) return priv-link ? 0 : -1; } +static struct eth_ops altera_tse_ops = { + .init = tse_eth_init, + .halt = tse_eth_halt, + .send = tse_eth_send, + .recv = tse_eth_rx, + .write_hwaddr = tse_set_mac_address +}; + /* TSE init code */ int altera_tse_initialize(u8 dev_num, int mac_base, int sgdma_rx_base, int sgdma_tx_base, @@ -951,11 +959,7 @@ int altera_tse_initialize(u8 dev_num, int mac_base, /* init eth structure */ dev-priv = priv; - dev-eo-init = tse_eth_init; - dev-eo-halt = tse_eth_halt; - dev-eo-send = tse_eth_send; - dev-eo-recv = tse_eth_rx; - dev-eo-write_hwaddr = tse_set_mac_address; + dev-eo = altera_tse_ops; sprintf(dev-name, %s-%hu, ALTERA_TSE, dev_num); eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 08/67] net: bfin_mac: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/bfin_mac.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c index ef4736f..b2c4b0f 100644 --- a/drivers/net/bfin_mac.c +++ b/drivers/net/bfin_mac.c @@ -91,6 +91,14 @@ static int bfin_miiphy_write(const char *devname, uchar addr, uchar reg, ushort return 0; } +static struct eth_ops bfin_emac_ops = { + .init = bfin_EMAC_init, + .halt = bfin_EMAC_halt, + .send = bfin_EMAC_send, + .recv = bfin_EMAC_recv, + .write_hwaddr = bfin_EMAC_setup_addr +}; + int bfin_EMAC_initialize(bd_t *bis) { struct eth_device *dev; @@ -103,11 +111,7 @@ int bfin_EMAC_initialize(bd_t *bis) dev-iobase = 0; dev-priv = 0; - dev-eo-init = bfin_EMAC_init; - dev-eo-halt = bfin_EMAC_halt; - dev-eo-send = bfin_EMAC_send; - dev-eo-recv = bfin_EMAC_recv; - dev-eo-write_hwaddr = bfin_EMAC_setup_addr; + dev-eo = bfin_emac_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 10/67] net: cs8900: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/cs8900.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c index 65a4254..a78eada 100644 --- a/drivers/net/cs8900.c +++ b/drivers/net/cs8900.c @@ -299,6 +299,13 @@ int cs8900_e2prom_write(struct eth_device *dev, u8 addr, u16 value) return 0; } +static struct eth_ops cs8900_ops = { + .init = cs8900_init, + .halt = cs8900_halt, + .send = cs8900_send, + .recv = cs8900_recv +}; + int cs8900_initialize(u8 dev_num, int base_addr) { struct eth_device *dev; @@ -320,10 +327,7 @@ int cs8900_initialize(u8 dev_num, int base_addr) dev-iobase = base_addr; dev-priv = priv; - dev-eo-init = cs8900_init; - dev-eo-halt = cs8900_halt; - dev-eo-send = cs8900_send; - dev-eo-recv = cs8900_recv; + dev-eo = cs8900_ops; /* Load MAC address from EEPROM */ cs8900_get_enetaddr(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 01/67] net: dm: Pull out ops from struct eth_device
Add struct eth_ops into include/net.h. Pull out ops (function pointers to functions init, send recv, halt etc.) from struct eth_device to the new struct eth_ops. Fix ops usage in all affected drivers. This is the first preparation step for DM in the net subsystem. Idea is to have pointers to the ops functions stored in a separate static structure. The structure then will be passed to the DM driver instance on driver init. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- arch/mips/cpu/mips32/au1x00/au1x00_eth.c | 10 +- arch/powerpc/cpu/mpc8220/fec.c |8 arch/powerpc/cpu/mpc8260/ether_fcc.c | 10 +- arch/powerpc/cpu/mpc8260/ether_scc.c |8 arch/powerpc/cpu/mpc85xx/ether_fcc.c | 10 +- arch/powerpc/cpu/mpc8xx/fec.c|8 arch/powerpc/cpu/mpc8xx/scc.c|8 board/Marvell/db64360/mv_eth.c |8 board/Marvell/db64460/mv_eth.c |8 board/davinci/da8xxevm/da830evm.c|2 +- board/esd/cpci750/mv_eth.c |8 board/evb64260/eth.c |8 board/prodrive/p3mx/mv_eth.c |8 drivers/net/4xx_enet.c |8 drivers/net/altera_tse.c | 10 +- drivers/net/armada100_fec.c |8 drivers/net/at91_emac.c | 10 +- drivers/net/ax88180.c|8 drivers/net/bfin_mac.c | 10 +- drivers/net/calxedaxgmac.c |8 drivers/net/cpsw.c |8 drivers/net/cs8900.c |8 drivers/net/davinci_emac.c | 10 +- drivers/net/dc2114x.c|8 drivers/net/designware.c | 10 +- drivers/net/dm9000x.c|8 drivers/net/dnet.c | 10 +- drivers/net/e1000.c |8 drivers/net/eepro100.c |8 drivers/net/enc28j60.c | 10 +- drivers/net/ep93xx_eth.c |8 drivers/net/ethoc.c | 10 +- drivers/net/fec_mxc.c| 10 +- drivers/net/fm/eth.c |8 drivers/net/fsl_mcdmafec.c |8 drivers/net/ftgmac100.c |8 drivers/net/ftmac100.c |8 drivers/net/greth.c |8 drivers/net/inca-ip_sw.c |8 drivers/net/ks8695eth.c |8 drivers/net/lan91c96.c |8 drivers/net/macb.c | 10 +- drivers/net/mcffec.c |8 drivers/net/mpc512x_fec.c|8 drivers/net/mpc5xxx_fec.c|8 drivers/net/mvgbe.c | 10 +- drivers/net/natsemi.c|8 drivers/net/ne2000_base.c|8 drivers/net/npe/npe.c|8 drivers/net/ns8382x.c|8 drivers/net/pcnet.c |8 drivers/net/plb2800_eth.c|8 drivers/net/rtl8139.c| 10 +- drivers/net/rtl8169.c|8 drivers/net/sh_eth.c |8 drivers/net/smc9.c | 10 +- drivers/net/smc911x.c|8 drivers/net/tsec.c | 10 +- drivers/net/tsi108_eth.c |8 drivers/net/uli526x.c|8 drivers/net/xilinx_axi_emac.c| 10 +- drivers/net/xilinx_emaclite.c|8 drivers/net/xilinx_ll_temac.c| 14 +++--- drivers/net/zynq_gem.c | 10 +- drivers/qe/uec.c |8 drivers/usb/eth/asix.c | 10 +- drivers/usb/eth/smsc95xx.c | 10 +- include/net.h| 17 +++-- net/eth.c| 16 69 files changed, 308 insertions(+), 303 deletions(-) diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_eth.c b/arch/mips/cpu/mips32/au1x00/au1x00_eth.c index ac03a45..2909fb3 100644 --- a/arch/mips/cpu/mips32/au1x00/au1x00_eth.c +++ b/arch/mips/cpu/mips32/au1x00/au1x00_eth.c @@ -295,11 +295,11 @@ int au1x00_enet_initialize(bd_t *bis){ sprintf(dev-name, Au1X00 ethernet); dev-iobase = 0; - dev-priv = 0; - dev-init =
[U-Boot] [PATCH v2 09/67] net: calxedaxgmac: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/calxedaxgmac.c | 14 ++ 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/calxedaxgmac.c b/drivers/net/calxedaxgmac.c index 2346feb..3550160 100644 --- a/drivers/net/calxedaxgmac.c +++ b/drivers/net/calxedaxgmac.c @@ -508,6 +508,15 @@ static void xgmac_halt(struct eth_device *dev) priv-rx_currdesc = 0; } +static struct eth_ops xgmac_ops = { + .init = xgmac_init, + .send = xgmac_tx, + .recv = xgmac_rx, + .halt = xgmac_halt +}; + + + int calxedaxgmac_initialize(u32 id, ulong base_addr) { struct eth_device *dev; @@ -543,10 +552,7 @@ int calxedaxgmac_initialize(u32 id, ulong base_addr) macaddr[0] = readl(regs-macaddr[0].lo); memcpy(dev-enetaddr, macaddr, 6); - dev-eo-init = xgmac_init; - dev-eo-send = xgmac_tx; - dev-eo-recv = xgmac_rx; - dev-eo-halt = xgmac_halt; + dev-eo = xgmac_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 11/67] net: davinci_emac: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/davinci_emac.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index a221092..5701f75 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c @@ -769,6 +769,14 @@ static int davinci_eth_rcv_packet (struct eth_device *dev) return (0); } +static struct eth_ops davinci_emac_ops = { + .init = davinci_eth_open, + .halt = davinci_eth_close, + .send = davinci_eth_send_packet, + .recv = davinci_eth_rcv_packet, + .write_hwaddr = davinci_eth_set_mac_addr +}; + /* * This function initializes the emac hardware. It does NOT initialize * EMAC modules power or pin multiplexors, that is done by board_init() @@ -791,11 +799,7 @@ int davinci_emac_initialize(void) sprintf(dev-name, DaVinci-EMAC); dev-iobase = 0; - dev-eo-init = davinci_eth_open; - dev-eo-halt = davinci_eth_close; - dev-eo-send = davinci_eth_send_packet; - dev-eo-recv = davinci_eth_rcv_packet; - dev-eo-write_hwaddr = davinci_eth_set_mac_addr; + dev-eo = davinci_emac_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 06/67] net: at91_emac: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/at91_emac.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/at91_emac.c b/drivers/net/at91_emac.c index 3395dcc..464d539 100644 --- a/drivers/net/at91_emac.c +++ b/drivers/net/at91_emac.c @@ -494,6 +494,14 @@ static int at91emac_write_hwaddr(struct eth_device *netdev) return 0; } +static struct eth_ops at91emac_ops = { + .init = at91emac_init, + .halt = at91emac_halt, + .send = at91emac_send, + .recv = at91emac_recv, + .write_hwaddr = at91emac_write_hwaddr +}; + int at91emac_register(bd_t *bis, unsigned long iobase) { emac_device *emac; @@ -518,11 +526,7 @@ int at91emac_register(bd_t *bis, unsigned long iobase) sprintf(dev-name, emac); dev-iobase = iobase; dev-priv = emacfix; - dev-eo-init = at91emac_init; - dev-eo-halt = at91emac_halt; - dev-eo-send = at91emac_send; - dev-eo-recv = at91emac_recv; - dev-eo-write_hwaddr = at91emac_write_hwaddr; + dev-eo = at91emac_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 02/67] net: 4xx_enet: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/4xx_enet.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/4xx_enet.c b/drivers/net/4xx_enet.c index 27b66dd..309e616 100644 --- a/drivers/net/4xx_enet.c +++ b/drivers/net/4xx_enet.c @@ -1905,6 +1905,13 @@ static int ppc_4xx_eth_rx (struct eth_device *dev) return length; } +static struct eth_ops ppc_4xx_eth_ops = { + .init = ppc_4xx_eth_init, + .send = ppc_4xx_eth_send, + .recv = ppc_4xx_eth_rx, + .halt = ppc_4xx_eth_halt +}; + int ppc_4xx_eth_initialize (bd_t * bis) { static int virgin = 0; @@ -2023,10 +2030,7 @@ int ppc_4xx_eth_initialize (bd_t * bis) sprintf (dev-name, ppc_4xx_eth%d, eth_num - CONFIG_EMAC_NR_START); dev-priv = (void *) hw; - dev-eo-init = ppc_4xx_eth_init; - dev-eo-halt = ppc_4xx_eth_halt; - dev-eo-send = ppc_4xx_eth_send; - dev-eo-recv = ppc_4xx_eth_rx; + dev-eo = ppc_4xx_eth_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 14/67] net: dnet: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/dnet.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/dnet.c b/drivers/net/dnet.c index be0891f..126828e 100644 --- a/drivers/net/dnet.c +++ b/drivers/net/dnet.c @@ -355,6 +355,13 @@ static void dnet_halt(struct eth_device *netdev) dnet_writew_mac(dnet, DNET_INTERNAL_MODE_REG, 0); } +static struct eth_ops dnet_ops = { + .init = dnet_init, + .halt = dnet_halt, + .send = dnet_send, + .recv = dnet_recv +}; + int dnet_eth_initialize(int id, void *regs, unsigned int phy_addr) { struct dnet_device *dnet; @@ -374,10 +381,7 @@ int dnet_eth_initialize(int id, void *regs, unsigned int phy_addr) dnet-phy_addr = phy_addr; sprintf(netdev-name, dnet%d, id); - netdev-eo-init = dnet_init; - netdev-eo-halt = dnet_halt; - netdev-eo-send = dnet_send; - netdev-eo-recv = dnet_recv; + netdev-eo = dnet_ops; dev_capa = readl(dnet-regs-VERCAPS) 0x; debug(%s: has %smdio, %sirq, %sgigabit, %sdma\n, netdev-name, -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 15/67] net: e1000: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/e1000.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index c9f9fb3..82e89d8 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -5118,6 +5118,13 @@ void e1000_get_bus_type(struct e1000_hw *hw) /* A list of all registered e1000 devices */ static LIST_HEAD(e1000_hw_list); +static struct eth_ops e1000_ops = { + .init = e1000_init, + .recv = e1000_poll, + .send = e1000_transmit, + .halt = e1000_disable +}; + /** PROBE - Look for an adapter, this routine's visible to the outside You should omit the last argument struct pci_device * for a non-PCI NIC @@ -5218,10 +5225,7 @@ e1000_initialize(bd_t * bis) nic-enetaddr[3], nic-enetaddr[4], nic-enetaddr[5]); /* Set up the function pointers and register the device */ - nic-eo-init = e1000_init; - nic-eo-recv = e1000_poll; - nic-eo-send = e1000_transmit; - nic-eo-halt = e1000_disable; + nic-eo = e1000_ops; eth_register(nic); } -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 13/67] net: designware: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/designware.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 2d92591..255819e 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -523,6 +523,14 @@ static int dw_mii_write(const char *devname, u8 addr, u8 reg, u16 val) } #endif +static struct eth_ops dw_eth_ops = { + .init = dw_eth_init, + .send = dw_eth_send, + .recv = dw_eth_recv, + .halt = dw_eth_halt, + .write_hwaddr = dw_write_hwaddr +}; + int designware_initialize(u32 id, ulong base_addr, u32 phy_addr, u32 interface) { struct eth_device *dev; @@ -559,11 +567,7 @@ int designware_initialize(u32 id, ulong base_addr, u32 phy_addr, u32 interface) priv-phy_configured = 0; priv-interface = interface; - dev-eo-init = dw_eth_init; - dev-eo-send = dw_eth_send; - dev-eo-recv = dw_eth_recv; - dev-eo-halt = dw_eth_halt; - dev-eo-write_hwaddr = dw_write_hwaddr; + dev-eo = dw_eth_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 07/67] net: ax88180: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/ax88180.c | 13 + 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/ax88180.c b/drivers/net/ax88180.c index 464f261..fc237ba 100644 --- a/drivers/net/ax88180.c +++ b/drivers/net/ax88180.c @@ -698,6 +698,14 @@ static void ax88180_read_mac_addr (struct eth_device *dev) } } +static struct eth_ops ax88180_ops = { + .init = ax88180_init, + .halt = ax88180_halt, + .send = ax88180_send, + .recv = ax88180_recv +}; + + /* === Exported SubProgram Bodies @@ -725,10 +733,7 @@ int ax88180_initialize (bd_t * bis) sprintf (dev-name, ax88180); dev-iobase = AX88180_BASE; dev-priv = priv; - dev-eo-init = ax88180_init; - dev-eo-halt = ax88180_halt; - dev-eo-send = ax88180_send; - dev-eo-recv = ax88180_recv; + dev-eo = ax88180_ops; priv-BusWidth = BUS_WIDTH_32; priv-PadSize = 3; -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 12/67] net: dc2114x: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/dc2114x.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/dc2114x.c b/drivers/net/dc2114x.c index 0361699..afdc088 100644 --- a/drivers/net/dc2114x.c +++ b/drivers/net/dc2114x.c @@ -207,6 +207,13 @@ static struct pci_device_id supported[] = { { } }; +static struct eth_ops dc21x4x_ops = { + .init = dc21x4x_init, + .halt = dc21x4x_halt, + .send = dc21x4x_send, + .recv = dc21x4x_recv +}; + int dc21x4x_initialize(bd_t *bis) { int idx=0; @@ -299,11 +306,8 @@ int dc21x4x_initialize(bd_t *bis) #else dev-iobase = pci_mem_to_phys(devbusfn, iobase); #endif - dev-priv = (void*) devbusfn; - dev-eo-init = dc21x4x_init; - dev-eo-halt = dc21x4x_halt; - dev-eo-send = dc21x4x_send; - dev-eo-recv = dc21x4x_recv; + dev-priv = (void *) devbusfn; + dev-eo = dc21x4x_ops; /* Ensure we're not sleeping. */ pci_write_config_byte(devbusfn, PCI_CFDA_PSM, WAKEUP); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 16/67] net: eepro100: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/eepro100.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c index e3aa720..91d7f0b 100644 --- a/drivers/net/eepro100.c +++ b/drivers/net/eepro100.c @@ -408,6 +408,13 @@ static struct pci_device_id supported[] = { {} }; +static struct eth_ops eepro100_ops = { + .init = eepro100_init, + .halt = eepro100_halt, + .send = eepro100_send, + .recv = eepro100_recv +}; + int eepro100_initialize (bd_t * bis) { pci_dev_t devno; @@ -458,10 +465,7 @@ int eepro100_initialize (bd_t * bis) sprintf (dev-name, i82559#%d, card_number); dev-priv = (void *) devno; /* this have to come before bus_to_phys() */ dev-iobase = bus_to_phys (iobase); - dev-eo-init = eepro100_init; - dev-eo-halt = eepro100_halt; - dev-eo-send = eepro100_send; - dev-eo-recv = eepro100_recv; + dev-eo = eepro100_ops; eth_register (dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 28/67] net: mcffec: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/mcffec.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c index 0aeb24e..31c8dcd 100644 --- a/drivers/net/mcffec.c +++ b/drivers/net/mcffec.c @@ -551,6 +551,13 @@ void fec_halt(struct eth_device *dev) memset(info-txbuf, 0, DBUF_LENGTH); } +static struct eth_ops fec_ops = { + .init = fec_init, + .halt = fec_halt, + .send = fec_send, + .recv = fec_recv +}; + int mcffec_initialize(bd_t * bis) { struct eth_device *dev; @@ -572,10 +579,7 @@ int mcffec_initialize(bd_t * bis) sprintf(dev-name, FEC%d, fec_info[i].index); dev-priv = fec_info[i]; - dev-eo-init = fec_init; - dev-eo-halt = fec_halt; - dev-eo-send = fec_send; - dev-eo-recv = fec_recv; + dev-eo = fec_ops; /* setup Receive and Transmit buffer descriptor */ #ifdef CONFIG_SYS_FEC_BUF_USE_SRAM -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 23/67] net: fsl_mcdmafec: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/fsl_mcdmafec.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/fsl_mcdmafec.c b/drivers/net/fsl_mcdmafec.c index 2e70d22..6a18809 100644 --- a/drivers/net/fsl_mcdmafec.c +++ b/drivers/net/fsl_mcdmafec.c @@ -512,6 +512,13 @@ static void fec_halt(struct eth_device *dev) #endif } +static struct eth_ops fec_ops = { + .init = fec_init, + .halt = fec_halt, + .send = fec_send, + .recv = fec_recv +}; + int mcdmafec_initialize(bd_t * bis) { struct eth_device *dev; @@ -533,10 +540,7 @@ int mcdmafec_initialize(bd_t * bis) sprintf(dev-name, FEC%d, fec_info[i].index); dev-priv = fec_info[i]; - dev-eo-init = fec_init; - dev-eo-halt = fec_halt; - dev-eo-send = fec_send; - dev-eo-recv = fec_recv; + dev-eo = fec_ops; /* setup Receive and Transmit buffer descriptor */ #ifdef CONFIG_SYS_DMA_USE_INTSRAM -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 30/67] net: mvgbe: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/mvgbe.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c index 6ddb6d6..eeb0741 100644 --- a/drivers/net/mvgbe.c +++ b/drivers/net/mvgbe.c @@ -647,6 +647,14 @@ static int mvgbe_recv(struct eth_device *dev) return 0; } +static struct eth_ops mvgbe_ops = { + .init = (int (*) (struct eth_device *, bd_t *))mvgbe_init, + .halt = (void (*) (struct eth_device *))mvgbe_halt, + .send = mvgbe_send, + .recv = mvgbe_recv, + .write_hwaddr = mvgbe_write_hwaddr +}; + int mvgbe_initialize(bd_t *bis) { struct mvgbe_device *dmvgbe; @@ -721,11 +729,7 @@ error1: return -1; } - dev-eo-init = (void *)mvgbe_init; - dev-eo-halt = (void *)mvgbe_halt; - dev-eo-send = (void *)mvgbe_send; - dev-eo-recv = (void *)mvgbe_recv; - dev-eo-write_hwaddr = (void *)mvgbe_write_hwaddr; + dev-eo = mvgbe_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 31/67] net: mpc512x_fec: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/mpc512x_fec.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/mpc512x_fec.c b/drivers/net/mpc512x_fec.c index 4aa3b28..d10a70a 100644 --- a/drivers/net/mpc512x_fec.c +++ b/drivers/net/mpc512x_fec.c @@ -608,6 +608,13 @@ static int mpc512x_fec_recv (struct eth_device *dev) return frame_length; } +static struct eth_ops mpc512x_fec_ops = { + .init = mpc512x_fec_init, + .halt = mpc512x_fec_halt, + .send = mpc512x_fec_send, + .recv = mpc512x_fec_recv +}; + // int mpc512x_fec_initialize (bd_t * bis) { @@ -629,10 +636,7 @@ int mpc512x_fec_initialize (bd_t * bis) # endif dev-priv = (void *)fec; dev-iobase = (int)im-fec; - dev-eo-init = mpc512x_fec_init; - dev-eo-halt = mpc512x_fec_halt; - dev-eo-send = mpc512x_fec_send; - dev-eo-recv = mpc512x_fec_recv; + dev-eo = mpc512x_fec_ops; sprintf (dev-name, FEC); eth_register (dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 36/67] net: pcnet: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/pcnet.c | 13 - 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c index 35254c3..8bb8c67 100644 --- a/drivers/net/pcnet.c +++ b/drivers/net/pcnet.c @@ -154,6 +154,12 @@ static struct pci_device_id supported[] = { {} }; +static struct eth_ops pcnet_ops = { + .init = pcnet_init, + .halt = pcnet_halt, + .send = pcnet_send, + .recv = pcnet_recv +}; int pcnet_initialize (bd_t * bis) { @@ -216,12 +222,9 @@ int pcnet_initialize (bd_t * bis) } /* -* Setup device structure and register the driver. +* Setup device ops and register the driver. */ - dev-eo-init = pcnet_init; - dev-eo-halt = pcnet_halt; - dev-eo-send = pcnet_send; - dev-eo-recv = pcnet_recv; + dev-eo = pcnet_ops; eth_register (dev); } -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 35/67] net: ns8382x: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/ns8382x.c | 13 + 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/ns8382x.c b/drivers/net/ns8382x.c index 8b08e0b..c433d3a 100644 --- a/drivers/net/ns8382x.c +++ b/drivers/net/ns8382x.c @@ -294,6 +294,14 @@ OUTL(struct eth_device *dev, int command, u_long addr) *(vu_long *) ((addr + dev-iobase)) = cpu_to_le32(command); } +static struct eth_ops ns8382x_ops = { + .init = ns8382x_init, + .halt = ns8382x_disable, + .send = ns8382x_send, + .recv = ns8382x_poll +}; + + /* Function: ns8382x_initialize * Description: Retrieves the MAC address of the card, and sets up some * globals required by other routines, and initializes the NIC, making it @@ -346,10 +354,7 @@ ns8382x_initialize(bd_t * bis) sprintf(dev-name, dp8382x#%d, card_number); dev-iobase = bus_to_phys(iobase); dev-priv = (void *) devno; - dev-eo-init = ns8382x_init; - dev-eo-halt = ns8382x_disable; - dev-eo-send = ns8382x_send; - dev-eo-recv = ns8382x_poll; + dev-eo = ns8382x_ops; /* ns8382x has a non-standard PM control register * in PCI config space. Some boards apparently need -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 39/67] net: rtl8169: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/rtl8169.c | 13 + 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c index c75fd4f..80f8443 100644 --- a/drivers/net/rtl8169.c +++ b/drivers/net/rtl8169.c @@ -872,6 +872,14 @@ static int rtl_init(struct eth_device *dev, bd_t *bis) return 1; } +static struct eth_ops rtl_ops = { + .init = rtl_reset, + .halt = rtl_halt, + .send = rtl_send, + .recv = rtl_recv +}; + + int rtl8169_initialize(bd_t *bis) { pci_dev_t devno; @@ -902,10 +910,7 @@ int rtl8169_initialize(bd_t *bis) dev-priv = (void *) devno; dev-iobase = (int)pci_mem_to_phys(devno, iobase); - dev-eo-init = rtl_reset; - dev-eo-halt = rtl_halt; - dev-eo-send = rtl_send; - dev-eo-recv = rtl_recv; + dev-eo = rtl_ops; eth_register (dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 37/67] net: plb2800_eth: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/plb2800_eth.c | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/plb2800_eth.c b/drivers/net/plb2800_eth.c index d3eb692..3b5861f 100644 --- a/drivers/net/plb2800_eth.c +++ b/drivers/net/plb2800_eth.c @@ -92,6 +92,12 @@ static unsigned char * plb2800_get_mac_addr(void); static int rx_new; static int mac_addr_set = 0; +static struct eth_ops plb2800_eth_ops = { + .init = plb2800_eth_init, + .halt = plb2800_eth_halt, + .send = plb2800_eth_send, + .recv = plb2800_eth_recv +}; int plb2800_eth_initialize(bd_t * bis) { @@ -110,10 +116,7 @@ int plb2800_eth_initialize(bd_t * bis) memset(dev, 0, sizeof(*dev)); sprintf(dev-name, PLB2800 Switch); - dev-eo-init = plb2800_eth_init; - dev-eo-halt = plb2800_eth_halt; - dev-eo-send = plb2800_eth_send; - dev-eo-recv = plb2800_eth_recv; + dev-eo = plb2800_eth_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 33/67] net: ne2000: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/ne2000_base.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ne2000_base.c b/drivers/net/ne2000_base.c index 2cc9743..f1fed0e 100644 --- a/drivers/net/ne2000_base.c +++ b/drivers/net/ne2000_base.c @@ -774,6 +774,13 @@ static int ne2k_send(struct eth_device *dev, void *packet, int length) return 0; } +static struct eth_ops ne2k_ops = { + .init = ne2k_init, + .halt = ne2k_halt, + .send = ne2k_send, + .recv = ne2k_recv +}; + /** * Setup the driver for use and register it with the eth layer * @return 0 on success, -1 on error (causing caller to print error msg) @@ -789,10 +796,7 @@ int ne2k_register(void) if (ne2k_setup_driver(dev)) return -1; - dev-eo-init = ne2k_init; - dev-eo-halt = ne2k_halt; - dev-eo-send = ne2k_send; - dev-eo-recv = ne2k_recv; + dev-eo = ne2k_ops; sprintf(dev-name, NE2000); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 34/67] net: npe: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/npe/npe.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/npe/npe.c b/drivers/net/npe/npe.c index d376c21..adff561 100644 --- a/drivers/net/npe/npe.c +++ b/drivers/net/npe/npe.c @@ -576,6 +576,13 @@ static int npe_rx(struct eth_device *dev) return 0; } +static struct eth_ops npe_ops = { + .init = npe_init, + .halt = npe_halt, + .send = npe_send, + .recv = npe_rx +}; + int npe_initialize(bd_t * bis) { static int virgin = 0; @@ -625,10 +632,7 @@ int npe_initialize(bd_t * bis) sprintf(dev-name, NPE%d, eth_num); dev-priv = (void *)p_npe; - dev-eo-init = npe_init; - dev-eo-halt = npe_halt; - dev-eo-send = npe_send; - dev-eo-recv = npe_rx; + dev-eo = npe_ops; p_npe-print_speed = 1; -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 18/67] net: ep93xx_eth: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/ep93xx_eth.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ep93xx_eth.c b/drivers/net/ep93xx_eth.c index 0b5cb3c..a2a1502 100644 --- a/drivers/net/ep93xx_eth.c +++ b/drivers/net/ep93xx_eth.c @@ -439,6 +439,13 @@ int ep93xx_miiphy_initialize(bd_t * const bd) } #endif +static struct eth_dev ep93xx_eth_ops = { + .init = ep93xx_eth_open, + .halt = ep93xx_eth_close, + .send = ep93xx_eth_send_packet, + .recv = ep93xx_eth_rcv_packet +}; + /** * Initialize the EP93xx MAC. The MAC hardware is reset. Buffers are * allocated, if necessary, for the TX and RX descriptor and status queues, @@ -499,10 +506,7 @@ int ep93xx_eth_initialize(u8 dev_num, int base_addr) dev-iobase = base_addr; dev-priv = priv; - dev-eo-init = ep93xx_eth_open; - dev-eo-halt = ep93xx_eth_close; - dev-eo-send = ep93xx_eth_send_packet; - dev-eo-recv = ep93xx_eth_rcv_packet; + dev-eo = ep93xx_eth_ops; sprintf(dev-name, ep93xx_eth-%hu, dev_num); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 22/67] net: greth.c: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/greth.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/greth.c b/drivers/net/greth.c index 150dccf..3794005 100644 --- a/drivers/net/greth.c +++ b/drivers/net/greth.c @@ -597,6 +597,13 @@ void greth_set_hwaddr(greth_priv * greth, unsigned char *mac) mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); } +static struct eth_ops greth_ops = { + .init = greth_init, + .halt = greth_halt, + .send = greth_send, + .recv = greth_recv +}; + int greth_initialize(bd_t * bis) { greth_priv *greth; @@ -623,10 +630,7 @@ int greth_initialize(bd_t * bis) debug(Found GRETH at %p, irq %d\n, greth-regs, greth-irq); dev-priv = (void *)greth; dev-iobase = (unsigned int)greth-regs; - dev-eo-init = greth_init; - dev-eo-halt = greth_halt; - dev-eo-send = greth_send; - dev-eo-recv = greth_recv; + dev-eo = greth_ops; greth-dev = dev; /* Reset Core */ -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 20/67] net: fec_mxc: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/fec_mxc.c | 15 ++- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index f8a5556..3259f07 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -915,6 +915,15 @@ static int fec_recv(struct eth_device *dev) return len; } +static struct eth_ops fec_ops = { + .init = fec_init, + .send = fec_send, + .recv = fec_recv, + .halt = fec_halt, + .write_hwaddr = fec_set_hwaddr +}; + + static int fec_probe(bd_t *bd, int dev_id, int phy_id, uint32_t base_addr) { struct eth_device *edev; @@ -943,11 +952,7 @@ static int fec_probe(bd_t *bd, int dev_id, int phy_id, uint32_t base_addr) memset(fec, 0, sizeof(*fec)); edev-priv = fec; - edev-eo-init = fec_init; - edev-eo-send = fec_send; - edev-eo-recv = fec_recv; - edev-eo-halt = fec_halt; - edev-eo-write_hwaddr = fec_set_hwaddr; + edev-eo = fec_ops; fec-eth = (struct ethernet_regs *)base_addr; fec-bd = bd; -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 21/67] net: ftgmac100: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/ftgmac100.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ftgmac100.c b/drivers/net/ftgmac100.c index 76391c1..7046829 100644 --- a/drivers/net/ftgmac100.c +++ b/drivers/net/ftgmac100.c @@ -525,6 +525,13 @@ static int ftgmac100_send(struct eth_device *dev, void *packet, int length) return 0; } +static struct eth_ops ftgmac100_ops = { + .init = ftgmac100_init, + .halt = ftgmac100_halt, + .send = ftgmac100_send, + .recv = ftgmac100_recv +}; + int ftgmac100_initialize(bd_t *bd) { struct eth_device *dev; @@ -548,10 +555,7 @@ int ftgmac100_initialize(bd_t *bd) sprintf(dev-name, FTGMAC100); dev-iobase = CONFIG_FTGMAC100_BASE; - dev-eo-init = ftgmac100_init; - dev-eo-halt = ftgmac100_halt; - dev-eo-send = ftgmac100_send; - dev-eo-recv = ftgmac100_recv; + dev-eo = ftgmac100_ops; dev-priv = priv; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 19/67] net: ethoc: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/ethoc.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c index 946b8e2..6a78605 100644 --- a/drivers/net/ethoc.c +++ b/drivers/net/ethoc.c @@ -482,6 +482,14 @@ static int ethoc_recv(struct eth_device *dev) return 0; } +static struct eth_ops ethoc_ops = { + .init = ethoc_init, + .halt = ethoc_halt, + .send = ethoc_send, + .recv = ethoc_recv, + .write_hwaddr = ethoc_set_mac_address +}; + int ethoc_initialize(u8 dev_num, int base_addr) { struct ethoc *priv; @@ -499,11 +507,7 @@ int ethoc_initialize(u8 dev_num, int base_addr) memset(dev, 0, sizeof(*dev)); dev-priv = priv; dev-iobase = base_addr; - dev-eo-init = ethoc_init; - dev-eo-halt = ethoc_halt; - dev-eo-send = ethoc_send; - dev-eo-recv = ethoc_recv; - dev-eo-write_hwaddr = ethoc_set_mac_address; + dev-eo = ethoc_ops; sprintf(dev-name, %s-%hu, ETHOC, dev_num); eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 25/67] net: ks8695eth: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/ks8695eth.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ks8695eth.c b/drivers/net/ks8695eth.c index b0703ef..4a5a27e 100644 --- a/drivers/net/ks8695eth.c +++ b/drivers/net/ks8695eth.c @@ -220,6 +220,13 @@ static int ks8695_eth_send(struct eth_device *dev, void *packet, int len) // +static struct eth_ops ks8695_eth_ops = { + .init = ks8695_eth_init, + .halt = ks8695_eth_halt, + .send = ks8695_eth_send, + .recv = ks8695_eth_recv +}; + int ks8695_eth_initialize(void) { struct eth_device *dev; @@ -230,10 +237,7 @@ int ks8695_eth_initialize(void) memset(dev, 0, sizeof(*dev)); dev-iobase = KS8695_IO_BASE + KS8695_LAN_DMA_TX; - dev-eo-init = ks8695_eth_init; - dev-eo-halt = ks8695_eth_halt; - dev-eo-send = ks8695_eth_send; - dev-eo-recv = ks8695_eth_recv; + dev-eo = ks8695_eth_ops; strcpy(dev-name, ks8695eth); eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 45/67] net: xilinx_axi_emac: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/xilinx_axi_emac.c | 15 ++- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c index 54a871b..44ece48 100644 --- a/drivers/net/xilinx_axi_emac.c +++ b/drivers/net/xilinx_axi_emac.c @@ -622,6 +622,15 @@ static int axiemac_bus_reset(struct mii_dev *bus) return 0; } +static struct eth_ops axiemac_ops = { + .init = axiemac_init, + .halt = axiemac_halt, + .send = axiemac_send, + .recv = axiemac_recv, + .write_hwaddr = axiemac_setup_mac +}; + + int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr, unsigned long dma_addr) { @@ -645,11 +654,7 @@ int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr, priv-dmatx = (struct axidma_reg *)dma_addr; /* RX channel offset is 0x30 */ priv-dmarx = (struct axidma_reg *)(dma_addr + 0x30); - dev-eo-init = axiemac_init; - dev-eo-halt = axiemac_halt; - dev-eo-send = axiemac_send; - dev-eo-recv = axiemac_recv; - dev-eo-write_hwaddr = axiemac_setup_mac; + dev-eo = axiemac_ops; #ifdef CONFIG_PHY_ADDR priv-phyaddr = CONFIG_PHY_ADDR; -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 40/67] net: smc91111: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/smc9.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/smc9.c b/drivers/net/smc9.c index 3ea7213..f237ef8 100644 --- a/drivers/net/smc9.c +++ b/drivers/net/smc9.c @@ -1331,6 +1331,14 @@ static void print_packet( byte * buf, int length ) } #endif +static struct eth_ops smc_ops = { + .init = smc_init, + .halt = smc_halt, + .send = smc_send, + .recv = smc_rcv, + .write_hwaddr = smc_write_hwaddr +}; + int smc9_initialize(u8 dev_num, int base_addr) { struct smc9_priv *priv; @@ -1357,11 +1365,7 @@ int smc9_initialize(u8 dev_num, int base_addr) dev-enetaddr[i] = SMC_inb(dev, (ADDR0_REG + i)); swap_to(FLASH); - dev-eo-init = smc_init; - dev-eo-halt = smc_halt; - dev-eo-send = smc_send; - dev-eo-recv = smc_rcv; - dev-eo-write_hwaddr = smc_write_hwaddr; + dev-eo = smc_ops; sprintf(dev-name, %s-%hu, SMC_DEV_NAME, dev_num); eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 43/67] net: tsi108_eth: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/tsi108_eth.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c index bed09d5..ea26c2c 100644 --- a/drivers/net/tsi108_eth.c +++ b/drivers/net/tsi108_eth.c @@ -718,6 +718,13 @@ static int marvell_88e_phy_config (struct eth_device *dev, int *speed, return 1; } +static struct eth_ops tsi108_eth_ops = { + .init = tsi108_eth_probe, + .halt = tsi108_eth_halt, + .send = tsi108_eth_send, + .recv = tsi108_eth_recv +}; + /* * External interface * @@ -739,10 +746,7 @@ int tsi108_eth_initialize (bd_t * bis) dev-iobase = ETH_BASE + (index * ETH_PORT_OFFSET); dev-priv = (void *)(phy_address[index]); - dev-eo-init = tsi108_eth_probe; - dev-eo-halt = tsi108_eth_halt; - dev-eo-send = tsi108_eth_send; - dev-eo-recv = tsi108_eth_recv; + dev-eo = tsi108_eth_ops; eth_register(dev); } -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 41/67] net: smc911x: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/smc911x.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 5ba1bdf..0369376 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c @@ -251,6 +251,13 @@ static int smc911x_miiphy_write(const char *devname, u8 phy, u8 reg, u16 val) } #endif +static struct eth_ops smc911x_ops = { + .init = smc911x_init, + .halt = smc911x_halt, + .send = smc911x_send, + .recv = smc911x_rx +}; + int smc911x_initialize(u8 dev_num, int base_addr) { unsigned long addrl, addrh; @@ -282,10 +289,7 @@ int smc911x_initialize(u8 dev_num, int base_addr) dev-enetaddr[5] = addrh 8; } - dev-eo-init = smc911x_init; - dev-eo-halt = smc911x_halt; - dev-eo-send = smc911x_send; - dev-eo-recv = smc911x_rx; + dev-eo = smc911x_ops; sprintf(dev-name, %s-%hu, DRIVERNAME, dev_num); eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 47/67] net: zynq_gem: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/zynq_gem.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index 3cba176..0a9a0f0 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -399,6 +399,14 @@ static int zynq_gem_miiphy_write(const char *devname, uchar addr, return phywrite(dev, addr, reg, val); } +static struct eth_ops zynq_gem_ops = { + .init = zynq_gem_init, + .halt = zynq_gem_halt, + .send = zynq_gem_send, + .recv = zynq_gem_recv, + .write_hwaddr = zynq_gem_setup_mac +}; + int zynq_gem_initialize(bd_t *bis, int base_addr) { struct eth_device *dev; @@ -425,11 +433,7 @@ int zynq_gem_initialize(bd_t *bis, int base_addr) dev-iobase = base_addr; - dev-eo-init = zynq_gem_init; - dev-eo-halt = zynq_gem_halt; - dev-eo-send = zynq_gem_send; - dev-eo-recv = zynq_gem_recv; - dev-eo-write_hwaddr = zynq_gem_setup_mac; + dev-eo = zynq_gem_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 46/67] net: xilinx_emaclite: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/xilinx_emaclite.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c index c0fefa7..b5be0a3 100644 --- a/drivers/net/xilinx_emaclite.c +++ b/drivers/net/xilinx_emaclite.c @@ -345,6 +345,13 @@ static int emaclite_recv(struct eth_device *dev) } +static struct eth_ops emaclite_ops = { + init = emaclite_init, + halt = emaclite_halt, + send = emaclite_send, + recv = emaclite_recv +}; + int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr, int txpp, int rxpp) { @@ -369,10 +376,7 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr, sprintf(dev-name, Xelite.%lx, base_addr); dev-iobase = base_addr; - dev-eo-init = emaclite_init; - dev-eo-halt = emaclite_halt; - dev-eo-send = emaclite_send; - dev-eo-recv = emaclite_recv; + dev-eo = emaclite_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 54/67] net: mpc85xx_fec: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- arch/powerpc/cpu/mpc85xx/ether_fcc.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/cpu/mpc85xx/ether_fcc.c b/arch/powerpc/cpu/mpc85xx/ether_fcc.c index 3b9eafa..f3c188d 100644 --- a/arch/powerpc/cpu/mpc85xx/ether_fcc.c +++ b/arch/powerpc/cpu/mpc85xx/ether_fcc.c @@ -435,6 +435,13 @@ static void fec_halt(struct eth_device* dev) } } +static struct eth_ops fec_ops = { + .init = fec_init, + .halt = fec_halt, + .send = fec_send, + .recv = fec_recv +}; + int fec_initialize(bd_t *bis) { struct eth_device* dev; @@ -448,10 +455,7 @@ int fec_initialize(bd_t *bis) sprintf(dev-name, FCC%d, ether_fcc_info[i].ether_index + 1); dev-priv = ether_fcc_info[i]; - dev-eo-init = fec_init; - dev-eo-halt = fec_halt; - dev-eo-send = fec_send; - dev-eo-recv = fec_recv; + dev-eo = fec_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 52/67] net: mpc8260_fec: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- arch/powerpc/cpu/mpc8260/ether_fcc.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/cpu/mpc8260/ether_fcc.c b/arch/powerpc/cpu/mpc8260/ether_fcc.c index 6b78235..c8dbc66 100644 --- a/arch/powerpc/cpu/mpc8260/ether_fcc.c +++ b/arch/powerpc/cpu/mpc8260/ether_fcc.c @@ -372,6 +372,13 @@ static void fec_halt(struct eth_device* dev) ~(FCC_GFMR_ENT | FCC_GFMR_ENR); } +static struct eth_ops fec_ops = { + .init = fec_init, + .halt = fec_halt, + .send = fec_send, + .recv = fec_recv +}; + int fec_initialize(bd_t *bis) { struct eth_device* dev; @@ -385,10 +392,7 @@ int fec_initialize(bd_t *bis) sprintf(dev-name, FCC%d, ether_fcc_info[i].ether_index + 1); dev-priv = ether_fcc_info[i]; - dev-eo-init = fec_init; - dev-eo-halt = fec_halt; - dev-eo-send = fec_send; - dev-eo-recv = fec_recv; + dev-eo = fec_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 44/67] net: uli526x: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/uli526x.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/uli526x.c b/drivers/net/uli526x.c index 33d8b49..65670db 100644 --- a/drivers/net/uli526x.c +++ b/drivers/net/uli526x.c @@ -198,6 +198,13 @@ static struct pci_device_id uli526x_pci_tbl[] = { {} }; +static struct eth_ops uli526x_ops = { + .init = uli526x_init_one, + .halt = uli526x_disable, + .send = uli526x_start_xmit, + .recv = uli526x_rx_packet +}; + /* ULI526X network board routine */ /* @@ -237,10 +244,7 @@ int uli526x_initialize(bd_t *bis) db-pdev = devno; dev-iobase = iobase; - dev-eo-init = uli526x_init_one; - dev-eo-halt = uli526x_disable; - dev-eo-send = uli526x_start_xmit; - dev-eo-recv = uli526x_rx_packet; + dev-eo = uli526x_ops; /* init db */ db-ioaddr = dev-iobase; -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 57/67] net: mpc8xx_fec: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- arch/powerpc/cpu/mpc8xx/fec.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/cpu/mpc8xx/fec.c b/arch/powerpc/cpu/mpc8xx/fec.c index 5934d92..5544f20 100644 --- a/arch/powerpc/cpu/mpc8xx/fec.c +++ b/arch/powerpc/cpu/mpc8xx/fec.c @@ -147,6 +147,13 @@ static void fec_halt(struct eth_device* dev); static void __mii_init(void); #endif +static struct eth_ops fec_ops = { + .init = fec_init, + .halt = fec_halt, + .send = fec_send, + .recv = fec_recv +}; + int fec_initialize(bd_t *bis) { struct eth_device* dev; @@ -178,10 +185,7 @@ int fec_initialize(bd_t *bis) efis-actual_phy_addr = -1; dev-priv = efis; - dev-eo-init = fec_init; - dev-eo-halt = fec_halt; - dev-eo-send = fec_send; - dev-eo-recv = fec_recv; + dev-eo = fec_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 56/67] net: db64360/mv_eth: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- board/Marvell/db64360/mv_eth.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/board/Marvell/db64360/mv_eth.c b/board/Marvell/db64360/mv_eth.c index 226b964..a0aafc7 100644 --- a/board/Marvell/db64360/mv_eth.c +++ b/board/Marvell/db64360/mv_eth.c @@ -202,6 +202,13 @@ void db64360_eth_disable (struct eth_device *dev) } +static struct eth_ops mv6436x_eth_ops = { + .init = (void *) db64360_eth_probe, + .halt = (void *) ethernet_phy_reset, + .send = (void *) db64360_eth_transmit, + .recv = (void *) db64360_eth_poll +}; + void mv6436x_eth_initialize (bd_t * bis) { struct eth_device *dev; @@ -259,10 +266,7 @@ void mv6436x_eth_initialize (bd_t * bis) /* ronen - set the MAC addr in the HW */ eth_port_uc_addr_set (devnum, dev-enetaddr, 0); - dev-eo-init = (void *) db64360_eth_probe; - dev-eo-halt = (void *) ethernet_phy_reset; - dev-eo-send = (void *) db64360_eth_transmit; - dev-eo-recv = (void *) db64360_eth_poll; + dev-eo = mv6436x_eth_ops; ethernet_private = calloc (sizeof (*ethernet_private), 1); dev-priv = (void *) ethernet_private; -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 24/67] net: inca-ip_sw: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/inca-ip_sw.c | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/inca-ip_sw.c b/drivers/net/inca-ip_sw.c index 216122d..ab91553 100644 --- a/drivers/net/inca-ip_sw.c +++ b/drivers/net/inca-ip_sw.c @@ -165,6 +165,12 @@ static void inca_init_switch_chip(void); static void inca_dma_init(void); static int inca_amdix(void); +static struct eth_ops inca_switch_ops = { + .init = inca_switch_init, + .halt = inca_switch_halt, + .send = inca_switch_send, + .recv = inca_switch_recv +}; int inca_switch_initialize(bd_t * bis) { @@ -189,10 +195,7 @@ int inca_switch_initialize(bd_t * bis) #endif sprintf(dev-name, INCA-IP Switch); - dev-eo-init = inca_switch_init; - dev-eo-halt = inca_switch_halt; - dev-eo-send = inca_switch_send; - dev-eo-recv = inca_switch_recv; + dev-eo = inca_switch_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 17/67] net: enc28j60: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/enc28j60.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index 95f0b93..cde4e1a 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c @@ -924,6 +924,14 @@ static void enc_halt(struct eth_device *dev) enc_release_bus(enc); } +static struct eth_ops enc28j60_ops = { + .init = enc_init, + .halt = enc_halt, + .send = enc_send, + .recv = enc_recv, + .write_hwaddr = enc_write_hwaddr +}; + /* * This is the only exported function. * @@ -962,11 +970,7 @@ int enc28j60_initialize(unsigned int bus, unsigned int cs, enc-dev = dev; /* now fill the eth_device object */ dev-priv = enc; - dev-eo-init = enc_init; - dev-eo-halt = enc_halt; - dev-eo-send = enc_send; - dev-eo-recv = enc_recv; - dev-eo-write_hwaddr = enc_write_hwaddr; + dev-eo = enc28j60_ops; sprintf(dev-name, enc%i.%i, bus, cs); eth_register(dev); #if defined(CONFIG_CMD_MII) -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 26/67] net: lan91c96: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/lan91c96.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/lan91c96.c b/drivers/net/lan91c96.c index d87302b..4e4e2e4 100644 --- a/drivers/net/lan91c96.c +++ b/drivers/net/lan91c96.c @@ -785,6 +785,13 @@ static int lan91c96_detect_chip(struct eth_device *dev) return 0; } +static struct eth_ops lan91c96_ops = { + .init = lan91c96_init, + .halt = lan91c96_halt, + .send = lan91c96_send, + .recv = lan91c96_recv +}; + int lan91c96_initialize(u8 dev_num, int base_addr) { struct eth_device *dev; @@ -806,10 +813,7 @@ int lan91c96_initialize(u8 dev_num, int base_addr) } get_rom_mac(dev, dev-enetaddr); - dev-eo-init = lan91c96_init; - dev-eo-halt = lan91c96_halt; - dev-eo-send = lan91c96_send; - dev-eo-recv = lan91c96_recv; + dev-eo = lan91c96_ops; sprintf(dev-name, %s-%hu, supported_chips[r].name, dev_num); eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 29/67] net: mpc5xxx_fec: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/mpc5xxx_fec.c | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/mpc5xxx_fec.c b/drivers/net/mpc5xxx_fec.c index 73503da..50f8100 100644 --- a/drivers/net/mpc5xxx_fec.c +++ b/drivers/net/mpc5xxx_fec.c @@ -879,6 +879,12 @@ static int mpc5xxx_fec_recv(struct eth_device *dev) return len; } +static struct eth_ops mpc5xxx_fec_ops = { + .init = mpc5xxx_fec_init, + .halt = mpc5xxx_fec_halt, + .send = mpc5xxx_fec_send, + .recv = mpc5xxx_fec_recv +}; // int mpc5xxx_fec_initialize(bd_t * bis) @@ -915,10 +921,7 @@ int mpc5xxx_fec_initialize(bd_t * bis) dev-priv = (void *)fec; dev-iobase = MPC5XXX_FEC; - dev-eo-init = mpc5xxx_fec_init; - dev-eo-halt = mpc5xxx_fec_halt; - dev-eo-send = mpc5xxx_fec_send; - dev-eo-recv = mpc5xxx_fec_recv; + dev-eo = mpc5xxx_fec_ops; sprintf(dev-name, FEC); eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 53/67] net: mpc8260_scc: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- arch/powerpc/cpu/mpc8260/ether_scc.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/cpu/mpc8260/ether_scc.c b/arch/powerpc/cpu/mpc8260/ether_scc.c index e56bfdf..5afe905 100644 --- a/arch/powerpc/cpu/mpc8260/ether_scc.c +++ b/arch/powerpc/cpu/mpc8260/ether_scc.c @@ -364,6 +364,13 @@ static void sec_restart(void) } #endif +static struct eth_ops sec_ops = { + .init = sec_init, + .halt = sec_halt, + .send = sec_send, + .recv = sec_rx +}; + int mpc82xx_scc_enet_initialize(bd_t *bis) { struct eth_device *dev; @@ -372,10 +379,7 @@ int mpc82xx_scc_enet_initialize(bd_t *bis) memset(dev, 0, sizeof *dev); sprintf(dev-name, SCC); - dev-eo-init = sec_init; - dev-eo-halt = sec_halt; - dev-eo-send = sec_send; - dev-eo-recv = sec_rx; + dev-eo = sec_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 63/67] net: fm_eth: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/fm/eth.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c index 8d881d4..d148957 100644 --- a/drivers/net/fm/eth.c +++ b/drivers/net/fm/eth.c @@ -611,6 +611,13 @@ static int init_phy(struct eth_device *dev) return 0; } +static struct eth_ops fm_eth_ops = { + .init = fm_eth_open, + .halt = fm_eth_halt, + .send = fm_eth_send, + .recv = fm_eth_recv +}; + int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info) { struct eth_device *dev; @@ -653,10 +660,7 @@ int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info) devlist[num_controllers++] = dev; dev-iobase = 0; dev-priv = (void *)fm_eth; - dev-eo-init = fm_eth_open; - dev-eo-halt = fm_eth_halt; - dev-eo-send = fm_eth_send; - dev-eo-recv = fm_eth_recv; + dev-eo = fm_eth_ops; fm_eth-dev = dev; fm_eth-bus = info-bus; fm_eth-phyaddr = info-phy_addr; -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 66/67] net: usb: asix: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/usb/eth/asix.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/usb/eth/asix.c b/drivers/usb/eth/asix.c index f2cea6b..ed8bcdd 100644 --- a/drivers/usb/eth/asix.c +++ b/drivers/usb/eth/asix.c @@ -692,6 +692,13 @@ int asix_eth_probe(struct usb_device *dev, unsigned int ifnum, return 1; } +static struct eth_ops asix_ops = { + .init = asix_init, + .halt = asix_halt, + .send = asix_send, + .recv = asix_recv +}; + int asix_eth_get_info(struct usb_device *dev, struct ueth_data *ss, struct eth_device *eth) { @@ -702,10 +709,7 @@ int asix_eth_get_info(struct usb_device *dev, struct ueth_data *ss, return 0; } sprintf(eth-name, %s%d, ASIX_BASE_NAME, curr_eth_dev++); - eth-eo-init = asix_init; - eth-eo-send = asix_send; - eth-eo-recv = asix_recv; - eth-eo-halt = asix_halt; + eth-eo = asix_ops; if (!(priv-flags FLAG_TYPE_AX88172)) eth-eo-write_hwaddr = asix_write_hwaddr; eth-priv = ss; -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 55/67] net: mpc8xx_scc: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- arch/powerpc/cpu/mpc8xx/scc.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/cpu/mpc8xx/scc.c b/arch/powerpc/cpu/mpc8xx/scc.c index 801c689..1d154f5 100644 --- a/arch/powerpc/cpu/mpc8xx/scc.c +++ b/arch/powerpc/cpu/mpc8xx/scc.c @@ -70,6 +70,13 @@ static int scc_recv(struct eth_device* dev); static int scc_init (struct eth_device* dev, bd_t * bd); static void scc_halt(struct eth_device* dev); +static struct eth_ops sec_ops = { + .init = scc_init, + .halt = scc_halt, + .send = scc_send, + .recv = scc_recv +}; + int scc_initialize(bd_t *bis) { struct eth_device* dev; @@ -80,10 +87,7 @@ int scc_initialize(bd_t *bis) sprintf(dev-name, SCC); dev-iobase = 0; dev-priv = 0; - dev-eo-init = scc_init; - dev-eo-halt = scc_halt; - dev-eo-send = scc_send; - dev-eo-recv = scc_recv; + dev-eo = sec_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 65/67] net: qe: uec: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/qe/uec.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c index 0aded61..09e267a 100644 --- a/drivers/qe/uec.c +++ b/drivers/qe/uec.c @@ -1361,6 +1361,13 @@ static int uec_recv(struct eth_device* dev) return 1; } +static struct eth_ops uec_ops = { + .init = uec_init, + .halt = uec_halt, + .send = uec_send, + .recv = uec_recv +}; + int uec_initialize(bd_t *bis, uec_info_t *uec_info) { struct eth_device *dev; @@ -1394,10 +1401,7 @@ int uec_initialize(bd_t *bis, uec_info_t *uec_info) sprintf(dev-name, UEC%d, uec_info-uf_info.ucc_num); dev-iobase = 0; dev-priv = (void *)uec; - dev-eo-init = uec_init; - dev-eo-halt = uec_halt; - dev-eo-send = uec_send; - dev-eo-recv = uec_recv; + dev-eo = uec_ops; /* Clear the ethnet address */ for (i = 0; i 6; i++) -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 51/67] net: mpc8220_fec: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- arch/powerpc/cpu/mpc8220/fec.c | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/cpu/mpc8220/fec.c b/arch/powerpc/cpu/mpc8220/fec.c index 9d6fcc1..289e7c2 100644 --- a/arch/powerpc/cpu/mpc8220/fec.c +++ b/arch/powerpc/cpu/mpc8220/fec.c @@ -799,6 +799,12 @@ static int mpc8220_fec_recv (struct eth_device *dev) return len; } +static struct eth_ops mpc8220_fec_ops = { + .init = mpc8220_fec_init, + .halt = mpc8220_fec_halt, + .send = mpc8220_fec_send, + .recv = mpc8220_fec_recv +}; // int mpc8220_fec_initialize (bd_t * bis) @@ -833,10 +839,7 @@ int mpc8220_fec_initialize (bd_t * bis) dev-priv = (void *) fec; dev-iobase = MMAP_FEC1; - dev-eo-init = mpc8220_fec_init; - dev-eo-halt = mpc8220_fec_halt; - dev-eo-send = mpc8220_fec_send; - dev-eo-recv = mpc8220_fec_recv; + dev-eo = mpc8220_fec_ops; sprintf (dev-name, FEC); eth_register (dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 67/67] net: usb: smsc95xx: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/usb/eth/smsc95xx.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/usb/eth/smsc95xx.c b/drivers/usb/eth/smsc95xx.c index b8c2f2e..9f278c5 100644 --- a/drivers/usb/eth/smsc95xx.c +++ b/drivers/usb/eth/smsc95xx.c @@ -881,6 +881,14 @@ int smsc95xx_eth_probe(struct usb_device *dev, unsigned int ifnum, return 1; } +static struct eth_ops smsc95xx_ops = { + .init = smsc95xx_init, + .halt = smsc95xx_halt, + .send = smsc95xx_send, + .recv = smsc95xx_recv, + .write_hwaddr = smsc95xx_write_hwaddr +}; + int smsc95xx_eth_get_info(struct usb_device *dev, struct ueth_data *ss, struct eth_device *eth) { @@ -890,11 +898,7 @@ int smsc95xx_eth_get_info(struct usb_device *dev, struct ueth_data *ss, return 0; } sprintf(eth-name, %s%d, SMSC95XX_BASE_NAME, curr_eth_dev++); - eth-eo-init = smsc95xx_init; - eth-eo-send = smsc95xx_send; - eth-eo-recv = smsc95xx_recv; - eth-eo-halt = smsc95xx_halt; - eth-eo-write_hwaddr = smsc95xx_write_hwaddr; + eth-eo = smsc95xx_ops; eth-priv = ss; return 1; } -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 58/67] net: db64460/mv_eth: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- board/Marvell/db64460/mv_eth.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/board/Marvell/db64460/mv_eth.c b/board/Marvell/db64460/mv_eth.c index df09be1..22bdafc 100644 --- a/board/Marvell/db64460/mv_eth.c +++ b/board/Marvell/db64460/mv_eth.c @@ -202,6 +202,13 @@ void db64460_eth_disable (struct eth_device *dev) } +static struct eth_ops mv6446x_eth_ops = { + .init = (void *) db64460_eth_probe, + .halt = (void *) ethernet_phy_reset, + .send = (void *) db64460_eth_transmit, + .recv = (void *) db64460_eth_poll +}; + void mv6446x_eth_initialize (bd_t * bis) { struct eth_device *dev; @@ -259,10 +266,7 @@ void mv6446x_eth_initialize (bd_t * bis) /* ronen - set the MAC addr in the HW */ eth_port_uc_addr_set (devnum, dev-enetaddr, 0); - dev-eo-init = (void *) db64460_eth_probe; - dev-eo-halt = (void *) ethernet_phy_reset; - dev-eo-send = (void *) db64460_eth_transmit; - dev-eo-recv = (void *) db64460_eth_poll; + dev-eo = mv6446x_eth_ops; ethernet_private = calloc (sizeof (*ethernet_private), 1); dev-priv = (void *)ethernet_private; -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 59/67] net: cpci750/mv_eth: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- board/esd/cpci750/mv_eth.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/board/esd/cpci750/mv_eth.c b/board/esd/cpci750/mv_eth.c index 8be3f9b..f825780 100644 --- a/board/esd/cpci750/mv_eth.c +++ b/board/esd/cpci750/mv_eth.c @@ -202,6 +202,13 @@ void db64360_eth_disable (struct eth_device *dev) } +static struct eth_ops mv6436x_eth_ops = { + .init = (void *) db64360_eth_probe, + .halt = (void *) ethernet_phy_reset, + .send = (void *) db64360_eth_transmit, + .recv = (void *) db64360_eth_poll +}; + void mv6436x_eth_initialize (bd_t * bis) { struct eth_device *dev; @@ -259,10 +266,7 @@ void mv6436x_eth_initialize (bd_t * bis) /* ronen - set the MAC addr in the HW */ eth_port_uc_addr_set (devnum, dev-enetaddr, 0); - dev-eo-init = (void *) db64360_eth_probe; - dev-eo-halt = (void *) ethernet_phy_reset; - dev-eo-send = (void *) db64360_eth_transmit; - dev-eo-recv = (void *) db64360_eth_poll; + dev-eo = mv6436x_eth_ops; ethernet_private = calloc (sizeof (*ethernet_private), 1); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 60/67] net: evb64260: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- board/evb64260/eth.c | 13 + 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/board/evb64260/eth.c b/board/evb64260/eth.c index 783e0ae..6f4300d 100644 --- a/board/evb64260/eth.c +++ b/board/evb64260/eth.c @@ -664,6 +664,14 @@ gt6426x_eth_probe(void *v, bd_t *bis) return 1; } + +static struct eth_ops gt6426x_eth_ops = { + .init = (void *) gt6426x_eth_probe, + .halt = (void *) gt6426x_eth_reset, + .send = (void *) gt6426x_eth_transmit, + .recv = (void *) gt6426x_eth_poll +}; + /* enter all the galileo ethernet devs into MULTI-BOOT */ void gt6426x_eth_initialize(bd_t *bis) @@ -720,10 +728,7 @@ gt6426x_eth_initialize(bd_t *bis) s = (*e) ? e+1 : e; } - dev-eo-init = (void *)gt6426x_eth_probe; - dev-eo-halt = (void *)gt6426x_eth_reset; - dev-eo-send = (void *)gt6426x_eth_transmit; - dev-eo-recv = (void *)gt6426x_eth_poll; + dev-eo = gt6426x_eth_ops; p = calloc( sizeof(*p), 1 ); dev-priv = (void*)p; -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 61/67] net: p3mx/mv_eth: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- board/prodrive/p3mx/mv_eth.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/board/prodrive/p3mx/mv_eth.c b/board/prodrive/p3mx/mv_eth.c index 69c2dba..cba749b 100644 --- a/board/prodrive/p3mx/mv_eth.c +++ b/board/prodrive/p3mx/mv_eth.c @@ -246,6 +246,13 @@ void mv_eth_phy_init (void) MV_REG_WRITE (ETH_PHY_DFCDL_CONFIG0_REG, 0x30); } +static struct eth_ops db64460_eth_ops = { + .init = (void *) db64460_eth_probe, + .halt = (void *) ethernet_phy_reset, + .send = (void *) db64460_eth_transmit, + .recv = (void *) db64460_eth_poll +}; + void mv6446x_eth_initialize (bd_t * bis) { struct eth_device *dev; @@ -309,10 +316,7 @@ void mv6446x_eth_initialize (bd_t * bis) /* ronen - set the MAC addr in the HW */ eth_port_uc_addr_set (devnum, dev-enetaddr, 0); - dev-eo-init = (void *) db64460_eth_probe; - dev-eo-halt = (void *) ethernet_phy_reset; - dev-eo-send = (void *) db64460_eth_transmit; - dev-eo-recv = (void *) db64460_eth_poll; + dev-eo = db64460_eth_ops; ethernet_private = calloc (sizeof (*ethernet_private), 1); dev-priv = (void *)ethernet_private; -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 49/67] net: sh_eth: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/sh_eth.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 1f8d0c1..e801bcb 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -502,6 +502,13 @@ void sh_eth_halt(struct eth_device *dev) sh_eth_stop(eth); } +static struct eth_ops sh_eth_ops = { + .init = sh_eth_init, + .halt = sh_eth_halt, + .send = sh_eth_send, + .recv = sh_eth_recv +}; + int sh_eth_initialize(bd_t *bd) { int ret = 0; @@ -529,10 +536,7 @@ int sh_eth_initialize(bd_t *bd) dev-priv = (void *)eth; dev-iobase = 0; - dev-eo-init = sh_eth_init; - dev-eo-halt = sh_eth_halt; - dev-eo-send = sh_eth_send; - dev-eo-recv = sh_eth_recv; + dev-eo = sh_eth_ops; eth-port_info[eth-port].dev = dev; sprintf(dev-name, SHETHER_NAME); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 38/67] net: rtl8139: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/rtl8139.c | 18 +++--- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c index ed02cf6..0e4e5d5 100644 --- a/drivers/net/rtl8139.c +++ b/drivers/net/rtl8139.c @@ -200,6 +200,16 @@ static struct pci_device_id supported[] = { {} }; +static struct eth_ops rtl8139_ops = { + .init = rtl8139_probe, + .halt = rtl_disable, + .send = rtl_transmit, + .recv = rtl_poll, +#ifdef CONFIG_MCAST_TFTP + .mcast = rtl_bcast_addr +#endif +}; + int rtl8139_initialize(bd_t *bis) { pci_dev_t devno; @@ -229,13 +239,7 @@ int rtl8139_initialize(bd_t *bis) dev-priv = (void *) devno; dev-iobase = (int)bus_to_phys(iobase); - dev-eo-init = rtl8139_probe; - dev-eo-halt = rtl_disable; - dev-eo-send = rtl_transmit; - dev-eo-recv = rtl_poll; -#ifdef CONFIG_MCAST_TFTP - dev-eo-mcast = rtl_bcast_addr; -#endif + dev-eo = rtl8139_ops; eth_register (dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 48/67] net: xilinx_ll_temac: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/xilinx_ll_temac.c | 27 --- 1 files changed, 20 insertions(+), 7 deletions(-) diff --git a/drivers/net/xilinx_ll_temac.c b/drivers/net/xilinx_ll_temac.c index 8f67417..5f52251 100644 --- a/drivers/net/xilinx_ll_temac.c +++ b/drivers/net/xilinx_ll_temac.c @@ -282,6 +282,24 @@ static int ll_temac_phy_init(struct eth_device *dev) return 1; } +static struct eth_ops ll_temac_ops_sdma = { + .init = ll_temac_init, + .halt = ll_temac_halt, + .write_hwaddr = ll_temac_setup_mac_addr, + .recv = ll_temac_recv_sdma, + .send = ll_temac_send_sdma +}; + +static struct eth_ops ll_temac_ops_fifo = { + .init = ll_temac_init, + .halt = ll_temac_halt, + .write_hwaddr = ll_temac_setup_mac_addr, + .recv = ll_temac_recv_fifo, + .send = ll_temac_send_fifo +}; + + + /* * Initialize a single ll_temac devices * @@ -313,9 +331,6 @@ int xilinx_ll_temac_initialize(bd_t *bis, struct ll_temac_info *devinf) dev-iobase = devinf-base_addr; dev-priv = ll_temac; - dev-eo-init = ll_temac_init; - dev-eo-halt = ll_temac_halt; - dev-eo-write_hwaddr = ll_temac_setup_mac_addr; ll_temac-ctrladdr = devinf-ctrl_addr; if (devinf-flags XILINX_LL_TEMAC_M_SDMA_PLB) { @@ -334,16 +349,14 @@ int xilinx_ll_temac_initialize(bd_t *bis, struct ll_temac_info *devinf) ll_temac-ctrlinit = ll_temac_init_sdma; ll_temac-ctrlhalt = ll_temac_halt_sdma; ll_temac-ctrlreset = ll_temac_reset_sdma; - dev-eo-recv = ll_temac_recv_sdma; - dev-eo-send = ll_temac_send_sdma; + dev-eo = ll_temac_ops_sdma; } else { ll_temac-in32 = NULL; ll_temac-out32 = NULL; ll_temac-ctrlinit = NULL; ll_temac-ctrlhalt = NULL; ll_temac-ctrlreset = ll_temac_reset_fifo; - dev-eo-recv = ll_temac_recv_fifo; - dev-eo-send = ll_temac_send_fifo; + dev-eo = ll_temac_ops_fifo; } /* Link to specified MDIO bus */ -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 32/67] net: natsemi: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/natsemi.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index 4288d1f..a3d78b9 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c @@ -273,6 +273,13 @@ OUTL(struct eth_device *dev, int command, u_long addr) *(vu_long *) ((addr + dev-iobase)) = cpu_to_le32(command); } +static struct eth_ops natsemi_ops = { + .init = natsemi_init, + .halt = natsemi_disable, + .send = natsemi_send, + .recv = natsemi_poll +}; + /* * Function: natsemi_initialize * @@ -332,10 +339,7 @@ natsemi_initialize(bd_t * bis) printf(natsemi: NatSemi ns8381[56] @ %#x\n, dev-iobase); #endif dev-priv = (void *) devno; - dev-eo-init = natsemi_init; - dev-eo-halt = natsemi_disable; - dev-eo-send = natsemi_send; - dev-eo-recv = natsemi_poll; + dev-eo = natsemi_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 50/67] net: au1x00_eth: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- arch/mips/cpu/mips32/au1x00/au1x00_eth.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_eth.c b/arch/mips/cpu/mips32/au1x00/au1x00_eth.c index 2909fb3..cd4c518 100644 --- a/arch/mips/cpu/mips32/au1x00/au1x00_eth.c +++ b/arch/mips/cpu/mips32/au1x00/au1x00_eth.c @@ -283,6 +283,13 @@ static void au1x00_halt(struct eth_device* dev){ *macen = 0; } +static struct eth_ops au1x00_ops = { + .init = au1x00_init, + .halt = au1x00_halt, + .send = au1x00_send, + .recv = au1x00_recv +}; + int au1x00_enet_initialize(bd_t *bis){ struct eth_device* dev; @@ -296,10 +303,7 @@ int au1x00_enet_initialize(bd_t *bis){ sprintf(dev-name, Au1X00 ethernet); dev-iobase = 0; dev-priv = 0; - dev-eo-init = au1x00_init; - dev-eo-halt = au1x00_halt; - dev-eo-send = au1x00_send; - dev-eo-recv = au1x00_recv; + dev-eo = au1x00_ops; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 42/67] net: tsec: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/tsec.c | 18 +++--- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 345d563..034f0ed 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -605,6 +605,16 @@ static int init_phy(struct eth_device *dev) return 1; } +static struct eth_ops tsec_ops = { + .init = tsec_init, + .halt = tsec_halt, + .send = tsec_send, + .recv = tsec_recv, +#ifdef CONFIG_MCAST_TFTP + .mcast = tsec_mcast_addr +#endif +}; + /* Initialize device structure. Returns success if PHY * initialization succeeded (i.e. if it recognizes the PHY) */ @@ -638,13 +648,7 @@ static int tsec_initialize(bd_t *bis, struct tsec_info_struct *tsec_info) priv-bus = miiphy_get_dev_by_name(tsec_info-mii_devname); dev-iobase = 0; dev-priv = priv; - dev-eo-init = tsec_init; - dev-eo-halt = tsec_halt; - dev-eo-send = tsec_send; - dev-eo-recv = tsec_recv; -#ifdef CONFIG_MCAST_TFTP - dev-eo-mcast = tsec_mcast_addr; -#endif + dev-eo = tsec_ops; /* Tell u-boot to get the addr from the env */ for (i = 0; i 6; i++) -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 62/67] net: cpsw: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/cpsw.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c index c120d4e..1e2ca40 100644 --- a/drivers/net/cpsw.c +++ b/drivers/net/cpsw.c @@ -931,6 +931,13 @@ static int cpsw_phy_init(struct eth_device *dev, struct cpsw_slave *slave) return 1; } +static struct eth_ops cpsw_ops = { + .init = cpsw_init, + .halt = cpsw_halt, + .send = cpsw_send, + .recv = cpsw_recv +}; + int cpsw_register(struct cpsw_platform_data *data) { struct cpsw_priv*priv; @@ -974,10 +981,7 @@ int cpsw_register(struct cpsw_platform_data *data) strcpy(dev-name, cpsw); dev-iobase = 0; - dev-eo-init = cpsw_init; - dev-eo-halt = cpsw_halt; - dev-eo-send = cpsw_send; - dev-eo-recv = cpsw_recv; + dev-eo = cpsw_ops; dev-priv = priv; eth_register(dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 64/67] net: ftmac100: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/ftmac100.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c index 6fd2bde..c353b3d 100644 --- a/drivers/net/ftmac100.c +++ b/drivers/net/ftmac100.c @@ -236,6 +236,13 @@ static int ftmac100_send(struct eth_device *dev, void *packet, int length) return 0; } +static struct eth_ops ftmac100_ops = { + .init = ftmac100_init, + .halt = ftmac100_halt, + .send = ftmac100_send, + .recv = ftmac100_recv +}; + int ftmac100_initialize (bd_t *bd) { struct eth_device *dev; @@ -260,10 +267,7 @@ int ftmac100_initialize (bd_t *bd) sprintf (dev-name, FTMAC100); dev-iobase = CONFIG_FTMAC100_BASE; - dev-eo-init = ftmac100_init; - dev-eo-halt = ftmac100_halt; - dev-eo-send = ftmac100_send; - dev-eo-recv = ftmac100_recv; + dev-eo = ftmac100_ops; dev-priv = priv; eth_register (dev); -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 27/67] net: macb: Pull out init of struct eth_ops
Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek tmshl...@gmail.com --- drivers/net/macb.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 2c53902..c0f1202 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -529,6 +529,14 @@ static int macb_write_hwaddr(struct eth_device *dev) return 0; } +static struct eth_ops macb_ops = { + .init = macb_init, + .halt = macb_halt, + .send = macb_send, + .recv = macb_recv, + .write_hwaddr = macb_write_hwaddr +}; + int macb_eth_initialize(int id, void *regs, unsigned int phy_addr) { struct macb_device *macb; @@ -558,11 +566,7 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr) macb-phy_addr = phy_addr; sprintf(netdev-name, macb%d, id); - netdev-eo-init = macb_init; - netdev-eo-halt = macb_halt; - netdev-eo-send = macb_send; - netdev-eo-recv = macb_recv; - netdev-eo-write_hwaddr = macb_write_hwaddr; + netdev-eo = macb_ops; /* * Do some basic initialization so that we at least can talk -- 1.7.2.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/8] boottime: Apply some key boottime tags into common code
Dear Lee Jones, In message 20121121093647.gh28...@gmail.com you wrote: show_boot_progress() code? Did you consider using this instead? If so, why did you not use it? No, I didn't know it existed. Basically I've taken responsibility to upstream someone else's driver. It's more of a kernel thing, but it This shouldbe considered a design fault. Why do you need an extra driver when standard mechanisms exist that provide exactly the needed funtionality? requires boottime information from u-boot too, as the intention is to cover full system booting, rather than the kernel-only tracing mechanisms which already exist. But we can share a log buffer with Linux, both hence and back, so why do you not simply use this feature? I've just taken a look at show_boot_process() though. It doesn't appear to be suitable for what we require. Each tag needs to be individually identifiable, and I'm not sure how you would achieve this if we were to call back into a single function which would do the tagging. Each call takes an argument which is exactly used for such identification purposes. And you implementation can be mapped to write syslog entries into a shared (with Linux) log buffer, so no changes in Linux are needed. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Computers are not intelligent. They only think they are. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/8] boottime: Add core boottime measurement support
Dear Lee Jones, In message 20121121095045.gi28...@gmail.com you wrote: Yes, I intend to extend this functionality into Device Tree. That way it will be architecture and OS independent. And forcing something upon a mechanism that was designed for a completely different purpose, where you see right from the first glance that it does not math easily? Not entirely sure what you mean here. This mechanism works perfectly with ATAGs. Neither ATAGS not the device tree are intended nor designed for passing logfile information. Yes, you can use them like that, and it will actually work. You can also drive a nail in using a microscope as hammer. The advantages should be obvious: we will need no extra kernel modification, we do not depend on ATAGS, and we are automatically architecture-independent. Wouldn't this clog up the kernel's log buffer? I'm sure no user wants to see reams of otherwise useless logging scrawled throughout their bootlog. We'd also have a write a text parser to obtain the information for processing. It would be easier to either pass in a struct, as we do with the ATAG mechanism, or though Device Tree as previously discussed. I think these are pretty poor arguments. There are standard methods (like log levels) to provide adequate filtering of which messages are passed on to a user. An there exists a plethora of tools for automatic filtering and post-processing of syslog messages. You will need to write _less_ code than with your homebrew implementation. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de And now remains That we find out the cause of this effect, Or rather say, the cause of this defect... -- Hamlet, Act II, Scene 2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/8] u8500: Correct unnecessary mathematical roll-over
Dear Lee Jones, In message 20121121100228.gj28...@gmail.com you wrote: -#define COUNT_TO_USEC(x) ((x) * 16 / 133) +#define COUNT_TO_USEC(x) ((x) / 133 * 16) Before the change, the result is useful for all values of x in the interval from 0 through UINT_MAX/16 = 268435455 = 268 seconds, i. e. for all values that make sense to be measured in microseconds. We're actually discussing this elsewhere. I don't have permission to paste the other side of the conversation, but I can show you my calculations: The original implementation is fine until we reach 32.28 seconds, which as you predicted is 0x1000_: 0x1000 * PRESCALER) / (CLOCK_SPEED_133_MHZ) (268435456 * 16 ) / (133 * 1000 * 1000) == 32.28 seconds If we spend 30 seconds at the u-boot commandline, which is not unreasonable by any stretch, then the kernel assumes responsibility for the remaining of the time spent at the prompt, which is obviously not acceptable for this usecase. This makes no sense to me. An overflow will not happen before UINT_MAX/16 = 268435455 = 268 seconds. Anyway. If you have overflof problems, then use proper arithmetics. If you need a bigger number range, then use proper arithmetics. It';s available, just use it. Would you be able to lend a hand here, as I'm no mathematician? What are the correct arithmetics? There are routines like do_div() or lldiv() etc. that can be used when 32 bit arithmetics is really not good enough. However, I fail to see why that should even be needed here. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de If God had wanted us to use the metric system, Jesus would have had 10 apostles. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/8] arm: Add boottime support for the ARM architecture
Dear Lee Jones, In message 20121121101310.gl28...@gmail.com you wrote: I expolained it in my reply to your cover letter, i.e. in the message immediately preceeding the one you replied to here. So you're telling me off for sending a patch which doesn't agree with something you've said, despite you saying it _after_ I sent the patch? Sounds sensible. :) Arghh... you don't _want_ to understand, right? I was referring to my reply to your cover letter (patch 0/8) within this very patch series. It makes little sense to repeat what I've already told you just one or two messages before, or does it? like the Linux log buffer for this purpose. As explained, this has the added benefit that you don't need to change any Linux code. And you can build on the (also existing) show_boot_progress() support in U-Boot, so the extesions should actually be really small and pretty clear. When you say log buffer, do you mean __log_buf? Doesn't this contain logs used for dmesg; thus won't all this crud end up in a user's dmesg kernel log? Unless there is another log which is used only for the kernel. Yes, I do mean __log_buf resp. the syslog services. Yes, this will end up in the log buffer than can be displayed with dmesg. If you consider this information crud, then consider to disable the feature. But then, guess why highres timestamps have been added to the kenrel logs? For people not interested in such informtion this is eventually crud, but for others it appears important enough that it got added to Linux mainline. If you are not interested in such information, then just use appropriate log levels and filtering. Also, wouldn't I then have to write a text parser to process this information? Sounds horrendous. Hopefully, I have missed something and it's actually easier than what I've mentioned. Guess how many tools are out there that already deal with filtering and post-processing of kernel log messages? A google search for syslog filter returns millions of hits... Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de As far as the laws of mathematics refer to reality, they are not cer- tain, and as far as they are certain, they do not refer to reality. -- Albert Einstein ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 00/67] net: net subsystem ops cleanup
Dear Tomas Hlavacek, In message 1353504238-11277-1-git-send-email-tmshl...@gmail.com you wrote: - Prove bisectability: MAKEALL arm (1/67 applied): Boards compiled: 274 MAKEALL arm (49/67 applied): Boards compiled: 274 MAKEALL arm (67/67 applied): Boards compiled: 274 To actually prove bisectability, so have to build all architectures (and not only a selection) for each and every commit (not only for a selection). And in addition to building, you have to verify that the resulting code actually works. 69 files changed, 590 insertions(+), 309 deletions(-) What's the impact on the memory footprint? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de If a computer can't directly address all the RAM you can use, it's just a toy. - anonymous comp.sys.amiga posting, non-sequitir ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v0] davinci: fixed cpu reset
The reset procedure works on watchdog timer while before it was modifying TIMER_1 registers. Tested on DM365. Signed-off-by: Davide Bonfanti davide.bonfa...@bticino.it --- arch/arm/cpu/arm926ejs/davinci/reset.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/cpu/arm926ejs/davinci/reset.c b/arch/arm/cpu/arm926ejs/davinci/reset.c index 968fb03..80f1ce9 100644 --- a/arch/arm/cpu/arm926ejs/davinci/reset.c +++ b/arch/arm/cpu/arm926ejs/davinci/reset.c @@ -16,7 +16,7 @@ void reset_cpu(unsigned long a) { struct davinci_timer *const wdttimer = - (struct davinci_timer *)DAVINCI_TIMER1_BASE; + (struct davinci_timer *)DAVINCI_WDOG_BASE; writel(0x08, wdttimer-tgcr); writel(readl(wdttimer-tgcr) | 0x03, wdttimer-tgcr); writel(0, wdttimer-tim12); -- 1.7.9.5 Ce message, ainsi que tous les fichiers joints à ce message, peuvent contenir des informations sensibles et/ ou confidentielles ne devant pas être divulguées. Si vous n'êtes pas le destinataire de ce message (ou que vous recevez ce message par erreur), nous vous remercions de le notifier immédiatement à son expéditeur, et de détruire ce message. Toute copie, divulgation, modification, utilisation ou diffusion, non autorisée, directe ou indirecte, de tout ou partie de ce message, est strictement interdite. This e-mail, and any document attached hereby, may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized, direct or indirect, copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/4] Optimized nand_read_buf for kirkwood
The basic idea is taken from the linux-kernel, but further optimized. First align the buffer to 8 bytes, then use ldrd/strd to read and store in 8 byte quantities, then do the final bytes. Signed-off-by: Nico Erfurth n...@erfurth.eu Cc: Prafulla Wadaskar prafu...@marvell.com --- drivers/mtd/nand/kirkwood_nand.c | 29 + 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/nand/kirkwood_nand.c b/drivers/mtd/nand/kirkwood_nand.c index bdab5aa..e04a59f 100644 --- a/drivers/mtd/nand/kirkwood_nand.c +++ b/drivers/mtd/nand/kirkwood_nand.c @@ -38,6 +38,34 @@ struct kwnandf_registers { static struct kwnandf_registers *nf_reg = (struct kwnandf_registers *)KW_NANDF_BASE; + +/* The basic idea is stolen from the linux kernel, but the inner loop is optimized a bit more */ +static void kw_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) +{ + struct nand_chip *chip = mtd-priv; + + while (len (unsigned long)buf 7) + { + *buf++ = readb(chip-IO_ADDR_R); + len--; + }; + + asm volatile ( + .LFlashLoop:\n + subs\t%0, #8\n + ldrpld\tr2, [%2]\n // Read 2 words + strpld\tr2, [%1], #8\n // Read 2 words + bpl\t.LFlashLoop\n // This results in one additional loop if len%8 0 + addne\t%0, #8\n + : +r (len), +r (buf) + : r (chip-IO_ADDR_R) + : r2, r3, memory, cc + ); + + while (len--) + *buf++ = readb(chip-IO_ADDR_R); +} + /* * hardware specific access to control-lines/bits */ @@ -76,6 +104,7 @@ int board_nand_init(struct nand_chip *nand) nand-options = NAND_COPYBACK | NAND_CACHEPRG | NAND_NO_PADDING; nand-ecc.mode = NAND_ECC_SOFT; nand-cmd_ctrl = kw_nand_hwcontrol; + nand-read_buf = kw_nand_read_buf; nand-chip_delay = 40; nand-select_chip = kw_nand_select_chip; return 0; -- 1.7.3.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/4] env_nand.c: do warn only if really no valid environment could be loaded
The warning is misleading, since there is no equivalent success note when reading the other copy succeeds. Signed-off-by: Phil Sutter phil.sut...@viprinet.com --- common/env_nand.c |9 + 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/common/env_nand.c b/common/env_nand.c index 895532b..58ba558 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -315,6 +315,7 @@ int get_nand_env_oob(nand_info_t *nand, unsigned long *result) void env_relocate_spec(void) { #if !defined(ENV_IS_EMBEDDED) + int read1_fail = 0, read2_fail = 0; int crc1_ok = 0, crc2_ok = 0; env_t *ep, *tmp_env1, *tmp_env2; @@ -326,11 +327,11 @@ void env_relocate_spec(void) goto done; } - if (readenv(CONFIG_ENV_OFFSET, (u_char *) tmp_env1)) - puts(No Valid Environment Area found\n); + read1_fail = readenv(CONFIG_ENV_OFFSET, (u_char *) tmp_env1); + read2_fail = readenv(CONFIG_ENV_OFFSET_REDUND, (u_char *) tmp_env2); - if (readenv(CONFIG_ENV_OFFSET_REDUND, (u_char *) tmp_env2)) - puts(No Valid Redundant Environment Area found\n); + if (read1_fail read2_fail) + puts(No Valid Environment Area found\n); crc1_ok = crc32(0, tmp_env1-data, ENV_SIZE) == tmp_env1-crc; crc2_ok = crc32(0, tmp_env2-data, ENV_SIZE) == tmp_env2-crc; -- 1.7.3.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 4/4] common/env_nand.c: calculate crc only when readenv was OK
Calculating the checksum of incompletely read data is useless. Signed-off-by: Phil Sutter phil.sut...@viprinet.com --- common/env_nand.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/env_nand.c b/common/env_nand.c index 58ba558..038aa00 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -333,8 +333,8 @@ void env_relocate_spec(void) if (read1_fail read2_fail) puts(No Valid Environment Area found\n); - crc1_ok = crc32(0, tmp_env1-data, ENV_SIZE) == tmp_env1-crc; - crc2_ok = crc32(0, tmp_env2-data, ENV_SIZE) == tmp_env2-crc; + crc1_ok = !read1_fail (crc32(0, tmp_env1-data, ENV_SIZE) == tmp_env1-crc); + crc2_ok = !read2_fail (crc32(0, tmp_env2-data, ENV_SIZE) == tmp_env2-crc); if (!crc1_ok !crc2_ok) { set_default_env(!bad CRC); -- 1.7.3.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/4] env_nand.c: support falling back to redundant env when writing
Without this patch, when the currently chosen environment to be written has bad blocks, saveenv fails completely. Instead, when there is redundant environment fall back to the other copy. Environment reading needs no adjustment, as the fallback logic for incomplete writes applies to this case as well. Signed-off-by: Phil Sutter phil.sut...@viprinet.com --- common/env_nand.c | 100 ++-- 1 files changed, 42 insertions(+), 58 deletions(-) diff --git a/common/env_nand.c b/common/env_nand.c index 79e8033..895532b 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -168,72 +168,53 @@ int writeenv(size_t offset, u_char *buf) return 0; } -#ifdef CONFIG_ENV_OFFSET_REDUND -static unsigned char env_flags; +typedef struct env_location { + const char *name; + nand_erase_options_t *erase_opts; + loff_t offset; +} env_location_t; -int saveenv(void) +static int erase_and_write_env(env_location_t *location, u_char *env_new) { - env_t env_new; - ssize_t len; - char*res; - int ret = 0; - nand_erase_options_t nand_erase_options; - - memset(nand_erase_options, 0, sizeof(nand_erase_options)); - nand_erase_options.length = CONFIG_ENV_RANGE; + int ret = 0; - if (CONFIG_ENV_RANGE CONFIG_ENV_SIZE) + printf(Erasing %s...\n, location-name); + location-erase_opts-offset = location-offset; + if (nand_erase_opts(nand_info[0], location-erase_opts)) return 1; - res = (char *)env_new.data; - len = hexport_r(env_htab, '\0', res, ENV_SIZE, 0, NULL); - if (len 0) { - error(Cannot export environment: errno = %d\n, errno); - return 1; - } - env_new.crc = crc32(0, env_new.data, ENV_SIZE); - env_new.flags = ++env_flags; /* increase the serial */ - - if (gd-env_valid == 1) { - puts(Erasing redundant NAND...\n); - nand_erase_options.offset = CONFIG_ENV_OFFSET_REDUND; - if (nand_erase_opts(nand_info[0], nand_erase_options)) - return 1; - - puts(Writing to redundant NAND... ); - ret = writeenv(CONFIG_ENV_OFFSET_REDUND, (u_char *)env_new); - } else { - puts(Erasing NAND...\n); - nand_erase_options.offset = CONFIG_ENV_OFFSET; - if (nand_erase_opts(nand_info[0], nand_erase_options)) - return 1; - - puts(Writing to NAND... ); - ret = writeenv(CONFIG_ENV_OFFSET, (u_char *)env_new); - } - if (ret) { + printf(Writing to %s... , location-name); + if ((ret = writeenv(location-offset, env_new))) puts(FAILED!\n); - return 1; - } - - puts(done\n); - - gd-env_valid = gd-env_valid == 2 ? 1 : 2; return ret; } -#else /* ! CONFIG_ENV_OFFSET_REDUND */ + +static unsigned char env_flags; + int saveenv(void) { int ret = 0; ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, 1); ssize_t len; char*res; + int env_idx; nand_erase_options_t nand_erase_options; + env_location_t location[] = {{ + .name = NAND, + .erase_opts = nand_erase_options, + .offset = CONFIG_ENV_OFFSET, +#ifdef CONFIG_ENV_OFFSET_REDUND + }, { + .name = redundant NAND, + .erase_opts = nand_erase_options, + .offset = CONFIG_ENV_OFFSET_REDUND, +#endif + }}; + memset(nand_erase_options, 0, sizeof(nand_erase_options)); nand_erase_options.length = CONFIG_ENV_RANGE; - nand_erase_options.offset = CONFIG_ENV_OFFSET; if (CONFIG_ENV_RANGE CONFIG_ENV_SIZE) return 1; @@ -244,22 +225,25 @@ int saveenv(void) error(Cannot export environment: errno = %d\n, errno); return 1; } - env_new-crc = crc32(0, env_new-data, ENV_SIZE); - - puts(Erasing Nand...\n); - if (nand_erase_opts(nand_info[0], nand_erase_options)) - return 1; + env_new-crc = crc32(0, env_new-data, ENV_SIZE); +#ifdef CONFIG_ENV_OFFSET_REDUND + env_new-flags = ++env_flags; /* increase the serial */ + env_idx = (gd-env_valid == 1); +#endif - puts(Writing to Nand... ); - if (writeenv(CONFIG_ENV_OFFSET, (u_char *)env_new)) { - puts(FAILED!\n); - return 1; - } + ret = erase_and_write_env(location[env_idx], (u_char *)env_new); +#ifdef CONFIG_ENV_OFFSET_REDUND + if (ret) { + env_idx = (env_idx + 1) 1; + ret = erase_and_write_env(location[env_idx], + (u_char *)env_new); + } else + gd-env_valid = gd-env_valid == 2 ? 1 : 2; +#endif puts(done\n); return ret; } -#endif /* CONFIG_ENV_OFFSET_REDUND
Re: [U-Boot] [PATCH 5/8] arm: Add boottime support for the ARM architecture
I expolained it in my reply to your cover letter, i.e. in the message immediately preceeding the one you replied to here. So you're telling me off for sending a patch which doesn't agree with something you've said, despite you saying it _after_ I sent the patch? Sounds sensible. :) Arghh... you don't _want_ to understand, right? I was referring to my reply to your cover letter (patch 0/8) within this very patch series. It makes little sense to repeat what I've already told you just one or two messages before, or does it? I think this is meerly a communication issue. I took I implicitly mentioned this before, here it comes clear again, to mean I've told you already, why aren't you listening to me. like the Linux log buffer for this purpose. As explained, this has the added benefit that you don't need to change any Linux code. And you can build on the (also existing) show_boot_progress() support in U-Boot, so the extesions should actually be really small and pretty clear. When you say log buffer, do you mean __log_buf? Doesn't this contain logs used for dmesg; thus won't all this crud end up in a user's dmesg kernel log? Unless there is another log which is used only for the kernel. Yes, I do mean __log_buf resp. the syslog services. Yes, this will end up in the log buffer than can be displayed with dmesg. If you consider this information crud, then consider to disable the feature. It's only curd to the user typing `dmesg`. If we're trying to measure whole system boot-up time, it's useful information. But then, guess why highres timestamps have been added to the kenrel logs? For people not interested in such informtion this is eventually crud, but for others it appears important enough that it got added to Linux mainline. If you are not interested in such information, then just use appropriate log levels and filtering. I think the kernel log is the wrong place for this to go. Although, the kernel driver will allow you to print the information in a log format by cat'ing debugfs/boottime/bootgraph, it's not really kernel logging information. It's mearly a collection of trace-points containing a timestamp and some means of identification. Filling the kernel log with lots of trace-points is definitely wrong. Also, wouldn't I then have to write a text parser to process this information? Sounds horrendous. Hopefully, I have missed something and it's actually easier than what I've mentioned. Guess how many tools are out there that already deal with filtering and post-processing of kernel log messages? A google search for syslog filter returns millions of hits... So you're suggesting that we create a userland portion of the driver too? I don't think this is acceptable. This tool will be used by kernel engineers, who would be more happy taking the information from debugfs. At least I know I would. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] .gitignore: ignore generated u-boot.lst
Signed-off-by: Vincent Stehlé v-ste...@ti.com --- .gitignore |1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1ac43f2..3f728ca 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,7 @@ /reloc_off /include/generated/ +/include/u-boot.lst asm-offsets.s # stgit generated dirs -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/8] u8500: Correct unnecessary mathematical roll-over
-#define COUNT_TO_USEC(x) ((x) * 16 / 133) +#define COUNT_TO_USEC(x) ((x) / 133 * 16) Before the change, the result is useful for all values of x in the interval from 0 through UINT_MAX/16 = 268435455 = 268 seconds, i. e. for all values that make sense to be measured in microseconds. We're actually discussing this elsewhere. I don't have permission to paste the other side of the conversation, but I can show you my calculations: The original implementation is fine until we reach 32.28 seconds, which as you predicted is 0x1000_: 0x1000 * PRESCALER) / (CLOCK_SPEED_133_MHZ) (268435456 * 16 ) / (133 * 1000 * 1000) == 32.28 seconds If we spend 30 seconds at the u-boot commandline, which is not unreasonable by any stretch, then the kernel assumes responsibility for the remaining of the time spent at the prompt, which is obviously not acceptable for this usecase. This makes no sense to me. An overflow will not happen before UINT_MAX/16 = 268435455 = 268 seconds. Right, but that's the timer. The issue here is not that the timer is overflowing, it's the arithmetics that takes place once the timer value is obtained. If a value of 0x1000 is read, then we carry out the arithmetic above, then other registers overflow. Anyway. If you have overflof problems, then use proper arithmetics. If you need a bigger number range, then use proper arithmetics. It';s available, just use it. Would you be able to lend a hand here, as I'm no mathematician? What are the correct arithmetics? There are routines like do_div() or lldiv() etc. that can be used when 32 bit arithmetics is really not good enough. Ah ha, thanks. However, I fail to see why that should even be needed here. As above. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/8] boottime: Add core boottime measurement support
Yes, I intend to extend this functionality into Device Tree. That way it will be architecture and OS independent. And forcing something upon a mechanism that was designed for a completely different purpose, where you see right from the first glance that it does not math easily? Not entirely sure what you mean here. This mechanism works perfectly with ATAGs. Neither ATAGS not the device tree are intended nor designed for passing logfile information. Yes, you can use them like that, and it will actually work. ATAGs were exactly designed for this type of thing. To pass small data structures though to the kernel. In our case, our trace-points are held in a small data structure. They're not logs. You can also drive a nail in using a microscope as hammer. Ah good idea. I have to try this. ;) The advantages should be obvious: we will need no extra kernel modification, we do not depend on ATAGS, and we are automatically architecture-independent. Wouldn't this clog up the kernel's log buffer? I'm sure no user wants to see reams of otherwise useless logging scrawled throughout their bootlog. We'd also have a write a text parser to obtain the information for processing. It would be easier to either pass in a struct, as we do with the ATAG mechanism, or though Device Tree as previously discussed. I think these are pretty poor arguments. There are standard methods (like log levels) to provide adequate filtering of which messages are passed on to a user. An there exists a plethora of tools for automatic filtering and post-processing of syslog messages. You will need to write _less_ code than with your homebrew implementation. They're not poor augments if the data stored isn't log messages, which these aren't. If anything I would say that ramming them in as textual kernel messages, then parsing the log text using a userspace tool was an abuse of the system. If we create them as data in the bootloader, then pass them to the kernel as data, then process them as data, _that_ would be the correct mechanism. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/8] boottime: Apply some key boottime tags into common code
show_boot_progress() code? Did you consider using this instead? If so, why did you not use it? No, I didn't know it existed. Basically I've taken responsibility to upstream someone else's driver. It's more of a kernel thing, but it This shouldbe considered a design fault. Why do you need an extra driver when standard mechanisms exist that provide exactly the needed funtionality? requires boottime information from u-boot too, as the intention is to cover full system booting, rather than the kernel-only tracing mechanisms which already exist. But we can share a log buffer with Linux, both hence and back, so why do you not simply use this feature? I've just taken a look at show_boot_process() though. It doesn't appear to be suitable for what we require. Each tag needs to be individually identifiable, and I'm not sure how you would achieve this if we were to call back into a single function which would do the tagging. Each call takes an argument which is exactly used for such identification purposes. And you implementation can be mapped to write syslog entries into a shared (with Linux) log buffer, so no changes in Linux are needed. It looked to me as though it took an integer identifier, which isn't going to mean anything to anyone. Unless there is a way to change the semantics of the function so that it would take a string, but then how would it play with the existing show_boot_progress() calls? -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/8] arm: Add boottime support for the ARM architecture
Dear Lee Jones, In message 20121121143928.ga28...@gmail.com you wrote: If you are not interested in such information, then just use appropriate log levels and filtering. I think the kernel log is the wrong place for this to go. Although, OK, this is your opinion, then, and I will respect it. It is my opinion that mechanisms as ATAGS or device tree are inappropriate for passing any kind of log data to the kernel. So far, the established way of passing logging information (like results of Power-On Selft Tests,e tc.) is through a shared log buffer. the kernel driver will allow you to print the information in a log format by cat'ing debugfs/boottime/bootgraph, it's not really kernel logging information. It's mearly a collection of trace-points containing a timestamp and some means of identification. I don't see what a kernel driver may be needed for, but for this part of the discussion this is not relevant anyway. Filling the kernel log with lots of trace-points is definitely wrong. Again, this is your opinion, and I respect it. On the other hand, what is the kernel log being used for on log level INFO, for example? So you're suggesting that we create a userland portion of the driver too? I don't think this is acceptable. This tool will be used by kernel engineers, who would be more happy taking the information from debugfs. At least I know I would. I do not suggest anything like that. I suggest not to write any driver at all, nor any other code. I suggest to use existing tools, as I recommend to reuse existing (standard) methods and protocols instead of inventing new ones. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de A witty saying proves nothing, but saying something pointless gets people's attention. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/8] boottime: Add core boottime measurement support
Dear Lee Jones, In message 20121121150332.gc28...@gmail.com you wrote: Neither ATAGS not the device tree are intended nor designed for passing logfile information. Yes, you can use them like that, and it will actually work. ATAGs were exactly designed for this type of thing. To pass small data structures though to the kernel. In our case, our trace-points are held in a small data structure. They're not logs. You appear to have a specific definition of log data in mind. It must be different to mine. Also, you contradict yourself - here you write pass small data structures, earlier you wrote about lots of trace-points, which sounds as if the total amount of data would be not exactly small - actually so big that yu are afraid of annoying users with it. Anyway. This doesn't take us further. They're not poor augments if the data stored isn't log messages, which these aren't. If anything I would say that ramming them in as textual kernel messages, then parsing the log text using a userspace tool was an abuse of the system. If we create them as data in the bootloader, then pass them to the kernel as data, then process them as data, _that_ would be the correct mechanism. Well, I could pooint out here a number of pretty basic design decisions made earlier in a number of pretty important and successful software projects, like the fact that a large number of internet protocols are based on plain text implementations. Or how useful it is if you can just to a post-mortem dump of the log buffer and actually _read_ the entries, without need to special tools. I think I should stop here, though. It appears it makes little sense trying to discuss alternative approaches when you have already fixed your mind about the one and only correct way to do this. To summarize: NAK. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de No journaling file system can recover your data if the disk dies. - Steve Rago in d4cw1p@plc.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 13/25] lib/zlib: sparse fixes
On Thu, Nov 08, 2012 at 07:06:31PM -0600, Kim Phillips wrote: On Thu, 8 Nov 2012 12:20:51 +0100 Wolfgang Denk w...@denx.de wrote: In message 1351553687-12469-14-git-send-email-kim.phill...@freescale.com you wrote: define Z_NULL to (void *)0 include/u-boot/zlib.h to get rid of most of the NULL pointer warnings. ... -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ +#define Z_NULL (void *)0 /* for initializing zalloc, zfree, opaque */ Don't we have to put parens around such an expression? I suppose. --- a/lib/zlib/adler32.c +++ b/lib/zlib/adler32.c @@ -54,10 +54,7 @@ #endif /* = */ -uLong ZEXPORT adler32(adler, buf, len) -uLong adler; -const Bytef *buf; -uInt len; +uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) Hm... this code has been imported from another project. This modification makes updates (or even comparing what has changed in more recent versions) much mor difficult, or even impossible :-( my goal is to improve u-boot code quality by eliminating as much sparse noise as possible - most boards use this code to decompress kernels, so it's widely used. E.g., this patch removes 52 lines of sparse output. But ok, we can revert this patch and turn off checking for these files, in the form of an #ifndef __CHECKER__ at the top, with an 'imported from another project' justification comment. Would that be better? My memory could be faulty here, but can't we rely on the kernel here? That'll give us sparse-clean zlib, or hints on how they're keeping it in sync. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 3/8] am33xx: NAND support
On Thu, Nov 15, 2012 at 11:26:59PM +0100, Peter Korsgaard wrote: Ilya Hm. Non-BCH layouts was here because I initially planned to Ilya support nandecc command to switch between supported ECC Ilya schemas... But as Tom requested to remove it I guess we don't Ilya need these layouts any more... Well, my idea was to make Ilya separate patches (one to just support existing omap_gpmc driver Ilya on AM33xx and one to add BCH8 support) and this kinda needs Ilya non-BCH layouts too... but I guess I should just squash the Ilya patches into one. I don't think non-BCH makes much sense on am33xx considering the ROM uses/requires BCH8. Long term (not today tho) we need to support BCH16 as well since the ROM requires BCH16 on some parts and BCH8 on others. We can cross that bridge when we come to it, however. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 6/8] omap_gpmc: BCH8 support (ELM based)
On Thu, Nov 15, 2012 at 02:25:23PM +0100, Andreas Bießmann wrote: Dear Ilya Yanok, On 07.11.2012 00:06, Ilya Yanok wrote: From: Mansoor Ahamed mansoor.aha...@ti.com This patch adds support for BCH8 error correction code to omap_gpmc driver. We use GPMC to generate codes/syndromes but we need ELM to find error locations from given syndrome. first of all, I wonder why this is so different than the kernel implementation for BCH. I mean the API (and content) of this and commit 8d602cf50d3bba864bc1438f486b626df69c87b3 mainline linux seems to differ. The main question coming to mind is: Is the resulting OOB layout compatible then? I think this has been mostly addressed now, but for clarity: - We do NOT want to have 1 layout used per NAND chip unless we must (historically we did because we had ROM that couldn't use 1bit ECC). - We DO want to utilize the HW as this is the only easy way to get a match with the BCH constants the ROM uses. - There are corresponding kernel patches already posted and working their way along. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot