dell_rbu.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * dell_rbu.c
  4. * Bios Update driver for Dell systems
  5. * Author: Dell Inc
  6. * Abhay Salunke <abhay_salunke@dell.com>
  7. *
  8. * Copyright (C) 2005 Dell Inc.
  9. *
  10. * Remote BIOS Update (rbu) driver is used for updating DELL BIOS by
  11. * creating entries in the /sys file systems on Linux 2.6 and higher
  12. * kernels. The driver supports two mechanism to update the BIOS namely
  13. * contiguous and packetized. Both these methods still require having some
  14. * application to set the CMOS bit indicating the BIOS to update itself
  15. * after a reboot.
  16. *
  17. * Contiguous method:
  18. * This driver writes the incoming data in a monolithic image by allocating
  19. * contiguous physical pages large enough to accommodate the incoming BIOS
  20. * image size.
  21. *
  22. * Packetized method:
  23. * The driver writes the incoming packet image by allocating a new packet
  24. * on every time the packet data is written. This driver requires an
  25. * application to break the BIOS image in to fixed sized packet chunks.
  26. *
  27. * See Documentation/admin-guide/dell_rbu.rst for more info.
  28. */
  29. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  30. #include <linux/init.h>
  31. #include <linux/module.h>
  32. #include <linux/slab.h>
  33. #include <linux/string.h>
  34. #include <linux/errno.h>
  35. #include <linux/blkdev.h>
  36. #include <linux/platform_device.h>
  37. #include <linux/spinlock.h>
  38. #include <linux/moduleparam.h>
  39. #include <linux/firmware.h>
  40. #include <linux/dma-mapping.h>
  41. #include <asm/set_memory.h>
  42. MODULE_AUTHOR("Abhay Salunke <abhay_salunke@dell.com>");
  43. MODULE_DESCRIPTION("Driver for updating BIOS image on DELL systems");
  44. MODULE_LICENSE("GPL");
  45. MODULE_VERSION("3.3");
  46. #define BIOS_SCAN_LIMIT 0xffffffff
  47. #define MAX_IMAGE_LENGTH 16
  48. static struct _rbu_data {
  49. void *image_update_buffer;
  50. unsigned long image_update_buffer_size;
  51. unsigned long bios_image_size;
  52. int image_update_ordernum;
  53. spinlock_t lock;
  54. unsigned long packet_read_count;
  55. unsigned long num_packets;
  56. unsigned long packetsize;
  57. unsigned long imagesize;
  58. int entry_created;
  59. } rbu_data;
  60. static char image_type[MAX_IMAGE_LENGTH + 1] = "mono";
  61. module_param_string(image_type, image_type, sizeof (image_type), 0);
  62. MODULE_PARM_DESC(image_type, "BIOS image type. choose- mono or packet or init");
  63. static unsigned long allocation_floor = 0x100000;
  64. module_param(allocation_floor, ulong, 0644);
  65. MODULE_PARM_DESC(allocation_floor, "Minimum address for allocations when using Packet mode");
  66. struct packet_data {
  67. struct list_head list;
  68. size_t length;
  69. void *data;
  70. int ordernum;
  71. };
  72. static struct list_head packet_data_list;
  73. static struct platform_device *rbu_device;
  74. static int context;
  75. static void init_packet_head(void)
  76. {
  77. INIT_LIST_HEAD(&packet_data_list);
  78. rbu_data.packet_read_count = 0;
  79. rbu_data.num_packets = 0;
  80. rbu_data.packetsize = 0;
  81. rbu_data.imagesize = 0;
  82. }
  83. static int create_packet(void *data, size_t length) __must_hold(&rbu_data.lock)
  84. {
  85. struct packet_data *newpacket;
  86. int ordernum = 0;
  87. int retval = 0;
  88. unsigned int packet_array_size = 0;
  89. void **invalid_addr_packet_array = NULL;
  90. void *packet_data_temp_buf = NULL;
  91. unsigned int idx = 0;
  92. pr_debug("entry\n");
  93. if (!rbu_data.packetsize) {
  94. pr_debug("packetsize not specified\n");
  95. retval = -EINVAL;
  96. goto out_noalloc;
  97. }
  98. spin_unlock(&rbu_data.lock);
  99. newpacket = kzalloc_obj(struct packet_data);
  100. if (!newpacket) {
  101. pr_warn("failed to allocate new packet\n");
  102. retval = -ENOMEM;
  103. spin_lock(&rbu_data.lock);
  104. goto out_noalloc;
  105. }
  106. ordernum = get_order(length);
  107. /*
  108. * BIOS errata mean we cannot allocate packets below 1MB or they will
  109. * be overwritten by BIOS.
  110. *
  111. * array to temporarily hold packets
  112. * that are below the allocation floor
  113. *
  114. * NOTE: very simplistic because we only need the floor to be at 1MB
  115. * due to BIOS errata. This shouldn't be used for higher floors
  116. * or you will run out of mem trying to allocate the array.
  117. */
  118. packet_array_size = max_t(unsigned int, allocation_floor / rbu_data.packetsize, 1);
  119. invalid_addr_packet_array = kcalloc(packet_array_size, sizeof(void *),
  120. GFP_KERNEL);
  121. if (!invalid_addr_packet_array) {
  122. pr_warn("failed to allocate invalid_addr_packet_array\n");
  123. retval = -ENOMEM;
  124. spin_lock(&rbu_data.lock);
  125. goto out_alloc_packet;
  126. }
  127. while (!packet_data_temp_buf) {
  128. packet_data_temp_buf = (unsigned char *)
  129. __get_free_pages(GFP_KERNEL, ordernum);
  130. if (!packet_data_temp_buf) {
  131. pr_warn("failed to allocate new packet\n");
  132. retval = -ENOMEM;
  133. spin_lock(&rbu_data.lock);
  134. goto out_alloc_packet_array;
  135. }
  136. if ((unsigned long)virt_to_phys(packet_data_temp_buf)
  137. < allocation_floor) {
  138. pr_debug("packet 0x%lx below floor at 0x%lx\n",
  139. (unsigned long)virt_to_phys(
  140. packet_data_temp_buf),
  141. allocation_floor);
  142. invalid_addr_packet_array[idx++] = packet_data_temp_buf;
  143. packet_data_temp_buf = NULL;
  144. }
  145. }
  146. /*
  147. * set to uncachable or it may never get written back before reboot
  148. */
  149. set_memory_uc((unsigned long)packet_data_temp_buf, 1 << ordernum);
  150. spin_lock(&rbu_data.lock);
  151. newpacket->data = packet_data_temp_buf;
  152. pr_debug("newpacket at physical addr %lx\n",
  153. (unsigned long)virt_to_phys(newpacket->data));
  154. /* packets may not have fixed size */
  155. newpacket->length = length;
  156. newpacket->ordernum = ordernum;
  157. ++rbu_data.num_packets;
  158. /* initialize the newly created packet headers */
  159. INIT_LIST_HEAD(&newpacket->list);
  160. list_add_tail(&newpacket->list, &packet_data_list);
  161. memcpy(newpacket->data, data, length);
  162. pr_debug("exit\n");
  163. out_alloc_packet_array:
  164. /* always free packet array */
  165. while (idx--) {
  166. pr_debug("freeing unused packet below floor 0x%lx\n",
  167. (unsigned long)virt_to_phys(invalid_addr_packet_array[idx]));
  168. free_pages((unsigned long)invalid_addr_packet_array[idx], ordernum);
  169. }
  170. kfree(invalid_addr_packet_array);
  171. out_alloc_packet:
  172. /* if error, free data */
  173. if (retval)
  174. kfree(newpacket);
  175. out_noalloc:
  176. return retval;
  177. }
  178. static int packetize_data(const u8 *data, size_t length)
  179. {
  180. int rc = 0;
  181. int done = 0;
  182. int packet_length;
  183. u8 *temp;
  184. u8 *end = (u8 *) data + length;
  185. pr_debug("data length %zd\n", length);
  186. if (!rbu_data.packetsize) {
  187. pr_warn("packetsize not specified\n");
  188. return -EIO;
  189. }
  190. temp = (u8 *) data;
  191. /* packetize the hunk */
  192. while (!done) {
  193. if ((temp + rbu_data.packetsize) < end)
  194. packet_length = rbu_data.packetsize;
  195. else {
  196. /* this is the last packet */
  197. packet_length = end - temp;
  198. done = 1;
  199. }
  200. rc = create_packet(temp, packet_length);
  201. if (rc)
  202. return rc;
  203. pr_debug("%p:%td\n", temp, (end - temp));
  204. temp += packet_length;
  205. }
  206. rbu_data.imagesize = length;
  207. return rc;
  208. }
  209. static int do_packet_read(char *data, struct packet_data *newpacket,
  210. int length, int bytes_read, int *list_read_count)
  211. {
  212. void *ptemp_buf;
  213. int bytes_copied = 0;
  214. int j = 0;
  215. *list_read_count += newpacket->length;
  216. if (*list_read_count > bytes_read) {
  217. /* point to the start of unread data */
  218. j = newpacket->length - (*list_read_count - bytes_read);
  219. /* point to the offset in the packet buffer */
  220. ptemp_buf = (u8 *) newpacket->data + j;
  221. /*
  222. * check if there is enough room in
  223. * * the incoming buffer
  224. */
  225. if (length > (*list_read_count - bytes_read))
  226. /*
  227. * copy what ever is there in this
  228. * packet and move on
  229. */
  230. bytes_copied = (*list_read_count - bytes_read);
  231. else
  232. /* copy the remaining */
  233. bytes_copied = length;
  234. memcpy(data, ptemp_buf, bytes_copied);
  235. }
  236. return bytes_copied;
  237. }
  238. static int packet_read_list(char *data, size_t *pread_length)
  239. {
  240. struct packet_data *newpacket;
  241. int temp_count = 0;
  242. int bytes_copied = 0;
  243. int bytes_read = 0;
  244. int remaining_bytes = 0;
  245. char *pdest = data;
  246. /* check if we have any packets */
  247. if (0 == rbu_data.num_packets)
  248. return -ENOMEM;
  249. remaining_bytes = *pread_length;
  250. bytes_read = rbu_data.packet_read_count;
  251. list_for_each_entry(newpacket, &packet_data_list, list) {
  252. bytes_copied = do_packet_read(pdest, newpacket,
  253. remaining_bytes, bytes_read, &temp_count);
  254. remaining_bytes -= bytes_copied;
  255. bytes_read += bytes_copied;
  256. pdest += bytes_copied;
  257. /*
  258. * check if we reached end of buffer before reaching the
  259. * last packet
  260. */
  261. if (remaining_bytes == 0)
  262. break;
  263. }
  264. /*finally set the bytes read */
  265. *pread_length = bytes_read - rbu_data.packet_read_count;
  266. rbu_data.packet_read_count = bytes_read;
  267. return 0;
  268. }
  269. static void packet_empty_list(void)
  270. {
  271. struct packet_data *newpacket, *tmp;
  272. list_for_each_entry_safe(newpacket, tmp, &packet_data_list, list) {
  273. list_del(&newpacket->list);
  274. /*
  275. * zero out the RBU packet memory before freeing
  276. * to make sure there are no stale RBU packets left in memory
  277. */
  278. memset(newpacket->data, 0, newpacket->length);
  279. set_memory_wb((unsigned long)newpacket->data,
  280. 1 << newpacket->ordernum);
  281. free_pages((unsigned long) newpacket->data,
  282. newpacket->ordernum);
  283. kfree(newpacket);
  284. }
  285. rbu_data.packet_read_count = 0;
  286. rbu_data.num_packets = 0;
  287. rbu_data.imagesize = 0;
  288. }
  289. /*
  290. * img_update_free: Frees the buffer allocated for storing BIOS image
  291. * Always called with lock held and returned with lock held
  292. */
  293. static void img_update_free(void)
  294. {
  295. if (!rbu_data.image_update_buffer)
  296. return;
  297. /*
  298. * zero out this buffer before freeing it to get rid of any stale
  299. * BIOS image copied in memory.
  300. */
  301. memset(rbu_data.image_update_buffer, 0,
  302. rbu_data.image_update_buffer_size);
  303. free_pages((unsigned long) rbu_data.image_update_buffer,
  304. rbu_data.image_update_ordernum);
  305. /*
  306. * Re-initialize the rbu_data variables after a free
  307. */
  308. rbu_data.image_update_ordernum = -1;
  309. rbu_data.image_update_buffer = NULL;
  310. rbu_data.image_update_buffer_size = 0;
  311. rbu_data.bios_image_size = 0;
  312. }
  313. /*
  314. * img_update_realloc: This function allocates the contiguous pages to
  315. * accommodate the requested size of data. The memory address and size
  316. * values are stored globally and on every call to this function the new
  317. * size is checked to see if more data is required than the existing size.
  318. * If true the previous memory is freed and new allocation is done to
  319. * accommodate the new size. If the incoming size is less then than the
  320. * already allocated size, then that memory is reused. This function is
  321. * called with lock held and returns with lock held.
  322. */
  323. static int img_update_realloc(unsigned long size)
  324. {
  325. unsigned char *image_update_buffer = NULL;
  326. unsigned long img_buf_phys_addr;
  327. int ordernum;
  328. /*
  329. * check if the buffer of sufficient size has been
  330. * already allocated
  331. */
  332. if (rbu_data.image_update_buffer_size >= size) {
  333. /*
  334. * check for corruption
  335. */
  336. if ((size != 0) && (rbu_data.image_update_buffer == NULL)) {
  337. pr_err("corruption check failed\n");
  338. return -EINVAL;
  339. }
  340. /*
  341. * we have a valid pre-allocated buffer with
  342. * sufficient size
  343. */
  344. return 0;
  345. }
  346. /*
  347. * free any previously allocated buffer
  348. */
  349. img_update_free();
  350. spin_unlock(&rbu_data.lock);
  351. ordernum = get_order(size);
  352. image_update_buffer =
  353. (unsigned char *)__get_free_pages(GFP_DMA32, ordernum);
  354. spin_lock(&rbu_data.lock);
  355. if (!image_update_buffer) {
  356. pr_debug("Not enough memory for image update: size = %ld\n", size);
  357. return -ENOMEM;
  358. }
  359. img_buf_phys_addr = (unsigned long)virt_to_phys(image_update_buffer);
  360. if (WARN_ON_ONCE(img_buf_phys_addr > BIOS_SCAN_LIMIT))
  361. return -EINVAL; /* can't happen per definition */
  362. rbu_data.image_update_buffer = image_update_buffer;
  363. rbu_data.image_update_buffer_size = size;
  364. rbu_data.bios_image_size = rbu_data.image_update_buffer_size;
  365. rbu_data.image_update_ordernum = ordernum;
  366. return 0;
  367. }
  368. static ssize_t read_packet_data(char *buffer, loff_t pos, size_t count)
  369. {
  370. int retval;
  371. size_t bytes_left;
  372. size_t data_length;
  373. char *ptempBuf = buffer;
  374. /* check to see if we have something to return */
  375. if (rbu_data.num_packets == 0) {
  376. pr_debug("no packets written\n");
  377. retval = -ENOMEM;
  378. goto read_rbu_data_exit;
  379. }
  380. if (pos > rbu_data.imagesize) {
  381. retval = 0;
  382. pr_warn("data underrun\n");
  383. goto read_rbu_data_exit;
  384. }
  385. bytes_left = rbu_data.imagesize - pos;
  386. data_length = min(bytes_left, count);
  387. retval = packet_read_list(ptempBuf, &data_length);
  388. if (retval < 0)
  389. goto read_rbu_data_exit;
  390. if ((pos + count) > rbu_data.imagesize) {
  391. rbu_data.packet_read_count = 0;
  392. /* this was the last copy */
  393. retval = bytes_left;
  394. } else
  395. retval = count;
  396. read_rbu_data_exit:
  397. return retval;
  398. }
  399. static ssize_t read_rbu_mono_data(char *buffer, loff_t pos, size_t count)
  400. {
  401. /* check to see if we have something to return */
  402. if ((rbu_data.image_update_buffer == NULL) ||
  403. (rbu_data.bios_image_size == 0)) {
  404. pr_debug("image_update_buffer %p, bios_image_size %lu\n",
  405. rbu_data.image_update_buffer,
  406. rbu_data.bios_image_size);
  407. return -ENOMEM;
  408. }
  409. return memory_read_from_buffer(buffer, count, &pos,
  410. rbu_data.image_update_buffer, rbu_data.bios_image_size);
  411. }
  412. static ssize_t data_read(struct file *filp, struct kobject *kobj,
  413. const struct bin_attribute *bin_attr,
  414. char *buffer, loff_t pos, size_t count)
  415. {
  416. ssize_t ret_count = 0;
  417. spin_lock(&rbu_data.lock);
  418. if (!strcmp(image_type, "mono"))
  419. ret_count = read_rbu_mono_data(buffer, pos, count);
  420. else if (!strcmp(image_type, "packet"))
  421. ret_count = read_packet_data(buffer, pos, count);
  422. else
  423. pr_debug("invalid image type specified\n");
  424. spin_unlock(&rbu_data.lock);
  425. return ret_count;
  426. }
  427. static const BIN_ATTR_RO(data, 0);
  428. static void callbackfn_rbu(const struct firmware *fw, void *context)
  429. {
  430. rbu_data.entry_created = 0;
  431. if (!fw)
  432. return;
  433. if (!fw->size)
  434. goto out;
  435. spin_lock(&rbu_data.lock);
  436. if (!strcmp(image_type, "mono")) {
  437. if (!img_update_realloc(fw->size))
  438. memcpy(rbu_data.image_update_buffer,
  439. fw->data, fw->size);
  440. } else if (!strcmp(image_type, "packet")) {
  441. /*
  442. * we need to free previous packets if a
  443. * new hunk of packets needs to be downloaded
  444. */
  445. packet_empty_list();
  446. if (packetize_data(fw->data, fw->size))
  447. /* Incase something goes wrong when we are
  448. * in middle of packetizing the data, we
  449. * need to free up whatever packets might
  450. * have been created before we quit.
  451. */
  452. packet_empty_list();
  453. } else
  454. pr_debug("invalid image type specified\n");
  455. spin_unlock(&rbu_data.lock);
  456. out:
  457. release_firmware(fw);
  458. }
  459. static ssize_t image_type_read(struct file *filp, struct kobject *kobj,
  460. const struct bin_attribute *bin_attr,
  461. char *buffer, loff_t pos, size_t count)
  462. {
  463. int size = 0;
  464. if (!pos)
  465. size = scnprintf(buffer, count, "%s\n", image_type);
  466. return size;
  467. }
  468. static ssize_t image_type_write(struct file *filp, struct kobject *kobj,
  469. const struct bin_attribute *bin_attr,
  470. char *buffer, loff_t pos, size_t count)
  471. {
  472. int rc = count;
  473. int req_firm_rc = 0;
  474. int i;
  475. spin_lock(&rbu_data.lock);
  476. /*
  477. * Find the first newline or space
  478. */
  479. for (i = 0; i < count; ++i)
  480. if (buffer[i] == '\n' || buffer[i] == ' ') {
  481. buffer[i] = '\0';
  482. break;
  483. }
  484. if (i == count)
  485. buffer[count] = '\0';
  486. if (strstr(buffer, "mono"))
  487. strcpy(image_type, "mono");
  488. else if (strstr(buffer, "packet"))
  489. strcpy(image_type, "packet");
  490. else if (strstr(buffer, "init")) {
  491. /*
  492. * If due to the user error the driver gets in a bad
  493. * state where even though it is loaded , the
  494. * /sys/class/firmware/dell_rbu entries are missing.
  495. * to cover this situation the user can recreate entries
  496. * by writing init to image_type.
  497. */
  498. if (!rbu_data.entry_created) {
  499. spin_unlock(&rbu_data.lock);
  500. req_firm_rc = request_firmware_nowait(THIS_MODULE,
  501. FW_ACTION_NOUEVENT, "dell_rbu",
  502. &rbu_device->dev, GFP_KERNEL, &context,
  503. callbackfn_rbu);
  504. if (req_firm_rc) {
  505. pr_err("request_firmware_nowait failed %d\n", rc);
  506. rc = -EIO;
  507. } else
  508. rbu_data.entry_created = 1;
  509. spin_lock(&rbu_data.lock);
  510. }
  511. } else {
  512. pr_warn("image_type is invalid\n");
  513. spin_unlock(&rbu_data.lock);
  514. return -EINVAL;
  515. }
  516. /* we must free all previous allocations */
  517. packet_empty_list();
  518. img_update_free();
  519. spin_unlock(&rbu_data.lock);
  520. return rc;
  521. }
  522. static const BIN_ATTR_RW(image_type, 0);
  523. static ssize_t packet_size_read(struct file *filp, struct kobject *kobj,
  524. const struct bin_attribute *bin_attr,
  525. char *buffer, loff_t pos, size_t count)
  526. {
  527. int size = 0;
  528. if (!pos) {
  529. spin_lock(&rbu_data.lock);
  530. size = scnprintf(buffer, count, "%lu\n", rbu_data.packetsize);
  531. spin_unlock(&rbu_data.lock);
  532. }
  533. return size;
  534. }
  535. static ssize_t packet_size_write(struct file *filp, struct kobject *kobj,
  536. const struct bin_attribute *bin_attr,
  537. char *buffer, loff_t pos, size_t count)
  538. {
  539. unsigned long temp;
  540. spin_lock(&rbu_data.lock);
  541. packet_empty_list();
  542. sscanf(buffer, "%lu", &temp);
  543. if (temp < 0xffffffff)
  544. rbu_data.packetsize = temp;
  545. spin_unlock(&rbu_data.lock);
  546. return count;
  547. }
  548. static const BIN_ATTR_RW(packet_size, 0);
  549. static const struct bin_attribute *const rbu_bin_attrs[] = {
  550. &bin_attr_data,
  551. &bin_attr_image_type,
  552. &bin_attr_packet_size,
  553. NULL
  554. };
  555. static const struct attribute_group rbu_group = {
  556. .bin_attrs = rbu_bin_attrs,
  557. };
  558. static int __init dcdrbu_init(void)
  559. {
  560. int rc;
  561. spin_lock_init(&rbu_data.lock);
  562. init_packet_head();
  563. rbu_device = platform_device_register_simple("dell_rbu", PLATFORM_DEVID_NONE, NULL, 0);
  564. if (IS_ERR(rbu_device)) {
  565. pr_err("platform_device_register_simple failed\n");
  566. return PTR_ERR(rbu_device);
  567. }
  568. rc = sysfs_create_group(&rbu_device->dev.kobj, &rbu_group);
  569. if (rc)
  570. goto out_devreg;
  571. rbu_data.entry_created = 0;
  572. return 0;
  573. out_devreg:
  574. platform_device_unregister(rbu_device);
  575. return rc;
  576. }
  577. static __exit void dcdrbu_exit(void)
  578. {
  579. spin_lock(&rbu_data.lock);
  580. packet_empty_list();
  581. img_update_free();
  582. spin_unlock(&rbu_data.lock);
  583. sysfs_remove_group(&rbu_device->dev.kobj, &rbu_group);
  584. platform_device_unregister(rbu_device);
  585. }
  586. module_exit(dcdrbu_exit);
  587. module_init(dcdrbu_init);