Esempio n. 1
0
 def ObtainContents(self):
     fname = tools.GetInputFilename('spl/u-boot-spl')
     bss_size = elf.GetSymbolAddress(fname, '__bss_size')
     if not bss_size:
         self.Raise('Expected __bss_size symbol in spl/u-boot-spl')
     self.data = chr(0) * bss_size
     self.contents_size = bss_size
Esempio n. 2
0
 def ObtainContents(self):
     fname = tools.GetInputFilename('spl/u-boot-spl')
     bss_size = elf.GetSymbolAddress(fname, '__bss_size')
     if not bss_size:
         self.Raise('Expected __bss_size symbol in spl/u-boot-spl')
     self.SetContents(tools.GetBytes(0, bss_size))
     return True
Esempio n. 3
0
 def ProcessFdt(self, fdt):
     # Figure out where to put the microcode pointer
     fname = tools.GetInputFilename(self.elf_fname)
     sym = elf.GetSymbolAddress(fname, '_dt_ucode_base_size')
     if sym:
         self.target_offset = sym
     elif not fdt_util.GetBool(self._node, 'optional-ucode'):
         self.Raise('Cannot locate _dt_ucode_base_size symbol in u-boot')
     return True
    def ObtainContents(self):
        # Figure out where to put the microcode pointer
        fname = tools.GetInputFilename(self.elf_fname)
        sym = elf.GetSymbolAddress(fname, '_dt_ucode_base_size')
        if sym:
            self.target_pos = sym
        elif not fdt_util.GetBool(self._node, 'optional-ucode'):
            self.Raise('Cannot locate _dt_ucode_base_size symbol in u-boot')

        return Entry_blob.ObtainContents(self)
    def testSymbols(self):
        """Test binman can assign symbols embedded in U-Boot"""
        elf_fname = self.TestFile('u_boot_binman_syms')
        syms = elf.GetSymbols(elf_fname, ['binman', 'image'])
        addr = elf.GetSymbolAddress(elf_fname, '__image_copy_start')
        self.assertEqual(syms['_binman_u_boot_spl_prop_pos'].address, addr)

        with open(self.TestFile('u_boot_binman_syms')) as fd:
            TestFunctional._MakeInputFile('spl/u-boot-spl', fd.read())
        data = self._DoReadFile('53_symbols.dts')
        sym_values = struct.pack('<LQL', 0x24 + 0, 0x24 + 24, 0x24 + 20)
        expected = (sym_values + U_BOOT_SPL_DATA[16:] + chr(0xff) +
                    U_BOOT_DATA + sym_values + U_BOOT_SPL_DATA[16:])
        self.assertEqual(expected, data)