* autogen.sh: Create symlinks to ${GRUB_CONTRIB} if necessary to
avoid confusing Automake. Run autogen only twice, once for the top
level and once for grub-core. Add Makefile.util.def and
Makefile.core.def from extra modules to the appropriate autogen
invocations. If Makefile.common exists in an extra module, include
it in both Makefile.util.am and grub-core/Makefile.core.am;
similarly, include any Makefile.util.common file in Makefile.util.am
and any Makefile.core.common file in grub-core/Makefile.core.am.
* conf/Makefile.common ($(top_srcdir)/grub-core/Makefile.core.am):
Depend on $(top_srcdir)/grub-core/Makefile.gcry.def.
($(top_srcdir)/grub-core/Makefile.gcry.def): Remove.
* grub-core/Makefile.am: Remove inclusion of Makefile.gcry.am.
* gentpl.py (gvar_add): Turn GVARS into a set.
(global_variable_initializers): Sort global variables on output.
(vars_init): New function.
(first_time): Likewise.
(library): Ensure that non-global variable initialisations are
emitted before the first time we emit code for a library block.
Append to variables rather than setting them. Only emit
noinst_LIBRARIES, BUILT_SOURCES, and CLEANFILES the first time for
each conditional path.
(program): installdir() emits an Autogen macro, so must be passed to
var_add rather than gvar_add.
(data): Likewise.
(script): Likewise.
(rules): New function, centralising handling for different target
types. Set up Guile association lists for first_time and vars_init,
and send most output to a diversion so that variable initialisations
can be emitted first.
(module_rules): Use new rules function.
(kernel_rules): Likewise.
(image_rules): Likewise.
(library_rules): Likewise.
(program_rules): Likewise.
(script_rules): Likewise.
(data_rules): Likewise.
* configure.ac: Add AC_PROG_LN_S, for the benefit of ntldr-img.
* .bzrignore: Add contrib and grub-core/contrib. Remove
grub-core/Makefile.gcry.am.
* Add gnulib files generated by gnulib-tool in build-aux, m4 and
grub-core/gnulib directories
* .bzignore: Add **/.deps and autogenerated gnulib files
* configure.ac: Assign auxiliary directory to build-aux, add invocation
of gnulib macros, add grub-core/gnulib/Makefile
* Makefile.am: Add gnulib directory in SUBDIRS (removing unnecessary .),
include m4 directory to aclocal.
* Makefile.util.def: Remove direct compilation of gnulib source files
and use the new grub-core/gnulib/libgnu.a.
* build-aux/config.rpath: move config.rpath from top directory to
build-aux
* conf/Makefile.common: Remove the macro _GL_UNUSED already defined
in gnulib headers
* conf/Makefile.extra-dist: Add m4/gnulib-cache.m4
* grub-core/Makefile.core.def: Remove unnecessary extra_dist
* grub-core/lib/posix_wrap/localcharset.h (locale_charset): Update
header.
* grub-core/lib/posix_wrap/langinfo.h (nl_langinfo): Return static
string.
* conf/Makefile.common (CFLAGS_PLATFORM): Add -mflush-func
=grub_cpu_flush_cache on all mips and not only yeeloong.
* configure.ac (COND_mips): New conditional.
* grub-core/Makefile.am (KERNEL_HEADER_FILES): Add libgcc on all
platforms.
* grub-core/kern/emu/cache.S (__mips__): Use _flush_cache.
* grub-core/kern/emu/full.c (grub_arch_dl_init_linker)
[GRUB_LINKER_HAVE_INIT]: New function.
(grub_emu_post_init): Likewise.
* grub-core/kern/emu/lite.c (grub_emu_post_init): Likewise.
* grub-core/kern/emu/main.c: Use grub_emu_post_init.
* include/grub/cache.h (_mips): Include mips/cache.h.
* include/grub/disk.h [GRUB_UTIL || GRUB_MACHINE_EMU]: Add missing
LVM and RAID prototypes.
* include/grub/emu/misc.h (grub_emu_post_init): New proto.
* include/grub/mips/time.h (grub_cpu_idle) [GRUB_MACHINE_EMU]: New
function.
Finally make USB usable.
* bus/usb/ohci.c (grub_ohci_reg_t): Add missing values.
(GRUB_OHCI_RHUB_PORT_POWER_MASK): New macro.
(GRUB_OHCI_RHUB_PORT_ALL_POWERED): Likewise.
(GRUB_OHCI_REG_FRAME_INTERVAL_FSMPS_MASK): Likewise.
(GRUB_OHCI_REG_FRAME_INTERVAL_FSMPS_SHIFT): Likewise.
(GRUB_OHCI_REG_FRAME_INTERVAL_FI_SHIFT): Likewise.
(GRUB_OHCI_FSMPS): Likewise.
(GRUB_OHCI_PERIODIC_START): Likewise.
(GRUB_OHCI_FRAME_INTERVAL): Likewise.
(GRUB_OHCI_SET_PORT_ENABLE): Likewise.
(GRUB_OHCI_CLEAR_PORT_ENABLE): Likewise.
(GRUB_OHCI_SET_PORT_RESET): Likewise.
(GRUB_OHCI_SET_PORT_RESET_STATUS_CHANGE): Likewise.
* bus/usb/ohci.c (grub_ohci_pci_iter): Various important fixups.
(grub_ohci_transaction): Likewise.
(grub_ohci_transfer): Improve condition detection algorithms.
Handle toggle property. Program the transactions correctly.
Improve error handling. Various important fixups.
(grub_ohci_portstatus): Put register writes in right order.
* bus/usb/uhci.c (grub_free_queue): Compute last_trans.
(grub_uhci_transfer): Don't show "failed" message on success.
* bus/usb/usb.c (grub_usb_set_configuration): Zero-fill whole "toggle"
array.
(grub_usb_device_initialize): Read first 8 bytes of descriptor to
determine its size.
* bus/usb/usbtrans.c (grub_usb_control_msg): Use descdev.maxsize0 even
before initialization is completed. Use IN direction for empty
transfers. Use last_trans and compute toggle.
* include/grub/usbtrans.h (grub_usb_transfer): New field last_trans.
(GRUB_USB_FEATURE_ENDP_HALT): Correct the value.
(GRUB_USB_FEATURE_DEV_REMOTE_WU): Likewise.
(GRUB_USB_FEATURE_TEST_MODE): Likewise.
* include/grub/usb.h (grub_usb_err_t): New value GRUB_USB_ERR_UNRECOVERABLE.
(grub_usb_device): Increase toggle to 256.
(grub_usbms_subclass_t): New values GRUB_USBMS_SUBCLASS_RBC,
GRUB_USBMS_SUBCLASS_MMC2, GRUB_USBMS_SUBCLASS_UFI and
GRUB_USBMS_SUBCLASS_SFF8070.
* include/grub/scsicmd.h (grub_scsi_test_unit_ready): New structure.
(grub_scsi_inquiry): New member page and alloc_length.
(grub_scsi_request_sense): New structure.
(grub_scsi_request_sense_data): Likewise.
(grub_scsi_read_capacity): New fields logical_block_addr, PMI and
control.
* disk/scsi.c (grub_scsi_request_sense): New function.
(grub_scsi_test_unit_ready): Likewise.
(grub_scsi_inquiry): Fill new fields.
(grub_scsi_read_capacity): Likewise.
(grub_scsi_read10): Add request sense at the end.
(grub_scsi_read12): Likewise.
(grub_scsi_write10): Likewise.
(grub_scsi_write12): Likewise.
(grub_scsi_open): Add Test Unit Ready.
* disk/usbms.c (grub_usbms_finddevs): Check configcnt.
Support additional subclasses. Con't clear halt yet. Activate the
proper config. Calculate LUNs correctly.
(grub_usbms_transfer): Various important fixups.
2010-06-02 Vladimir Serbinenko <phcoder@gmail.com>
* bus/pci.c (grub_pci_iterate) [GRUB_MACHINE_MIPS_YEELOONG]: Skip ghosts.
* bus/usb/ohci.c (grub_ohci_portstatus): Handle R/WC correctly.
(grub_ohci_fini_hw): New function.
(grub_ohci_restore_hw): Likewise.
(GRUB_MOD_INIT(ohci)): Register preboot hook.
(GRUB_MOD_FINI(ohci)): Shutdown OHCI.
* term/usb_keyboard.c: Remove include of grub/machine/console.h.
2010-06-02 Vladimir Serbinenko <phcoder@gmail.com>
Dedicated DMA allocations.
* bus/pci.c (grub_memalign_dma32): New function
(grub_dma_free): Likewise.
(grub_dma_get_virt): Likewise.
(grub_dma_get_phys): Likewise.
* bus/usb/ohci.c (grub_ohci): New members hcca_addr and hcca_chunk.
(grub_ohci_pci_iter): Use dma32_alloc.
(grub_ohci_transfer): Likewise.
* bus/usb/usbtrans.c (grub_usb_control_msg): Likewise.
(grub_usb_bulk_readwrite): Likewise.
* include/grub/pci.h: Add declarations.
2010-06-02 Vladimir Serbinenko <phcoder@gmail.com>
CS5536 support.
* bus/cs5536.c: New file.
* bus/usb/ohci.c (grub_ohci_pci_iter): Check for CS5536.
* conf/i386.rmk (pkglib_MODULES): Add cs5536.mod.
(cs5536_mod_SOURCES): New variable.
(cs5536_mod_CFLAGS): Likewise.
(cs5536_mod_LDFLAGS): Likewise.
* conf/mips-yeeloong.rmk (kernel_img_HEADERS): Add cs5536.h and
machine/pci.h.
(kernel_img_SOURCES): Add bus/cs5536.c.
(pkglib_MODULES): Add usb.mod, usbtest.mod, ohci.mod, usbms.mod and
usb_keyboard.mod.
(usb_mod_SOURCES): New variable.
(usb_mod_CFLAGS): New variable.
(usb_mod_LDFLAGS): New variable.
(usbtest_mod_SOURCES): New variable.
(usbtest_mod_CFLAGS): New variable.
(usbtest_mod_LDFLAGS): New variable.
(ohci_mod_SOURCES): New variable.
(ohci_mod_CFLAGS): New variable.
(ohci_mod_LDFLAGS): New variable.
(usbms_mod_SOURCES): New variable.
(usbms_mod_CFLAGS): New variable.
(usbms_mod_LDFLAGS): New variable.
(usb_keyboard_mod_SOURCES): New variable.
(usb_keyboard_mod_CFLAGS): New variable.
(usb_keyboard_mod_LDFLAGS): New variable.
* include/grub/smbus.h: New file.
* include/grub/cs5536.h: New file.
Also-By: Vladimir Serbinenko <phcoder@gmail.com>
* util/hostdisk.c (device_is_mapped): New function.
(find_partition_start): New function, partly broken out from
linux_find_partition and grub_util_biosdisk_get_grub_dev but with
device-mapper support added.
(linux_find_partition): Use find_partition_start.
(convert_system_partition_to_system_disk): Add `st' argument.
Support Linux /dev/mapper/* devices if device-mapper support is
available; only DM-RAID devices are understood at present.
(find_system_device): Add `st' argument. Pass it to
convert_system_partition_to_system_disk.
(grub_util_biosdisk_get_grub_dev): Pass stat result to
find_system_device and convert_system_partition_to_system_disk. Use
find_partition_start.
* conf/common.rmk (grub_mkdevicemap_SOURCES): Add kern/env.c,
kern/err.c, kern/list.c, kern/misc.c, and kern/emu/mm.c.
* util/deviceiter.c [__linux__]: Define MINOR.
(grub_util_iterate_devices): Add support for DM-RAID disk devices.
* util/mkdevicemap.c (grub_putchar): New function.
(grub_getkey): New function.
(grub_refresh): New function.
(main): Set debug=all if -v -v is used.